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