In python, I can type import Image
to import the Python Imaging Library (PIL). I can just type that instead of from PIL import Image
, like everyone else seems to do. How come I can do this? Is there any difference between from PIL import Image
and import Image
?
Should I assume that other people can't do this? (That is, when writing code to distribute to others.)
I use Python 2.7.4. Here's an example of code that runs perfectly for me in the REPL:
> import Image
> x = Image.new("RGB",(32,32),"blue)
> x.save("test.png","PNG")