mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 05:34:36 +03:00
Changed tutorial code to use with for opening files [ci skip]
This commit is contained in:
parent
cafc311943
commit
5eabd731f0
|
@ -476,7 +476,7 @@ Reading from an open file
|
||||||
::
|
::
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
fp = open("hopper.ppm", "rb")
|
with open("hopper.ppm", "rb") as fp:
|
||||||
im = Image.open(fp)
|
im = Image.open(fp)
|
||||||
|
|
||||||
To read an image from string data, use the :py:class:`~StringIO.StringIO`
|
To read an image from string data, use the :py:class:`~StringIO.StringIO`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user