Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80896

How modules work in Python

Date 2014-11-16 20:36 +0100
Subject How modules work in Python
From Abdul Abdul <abdul.sw84@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15893.1416169215.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello,

I'm new to Python, and just have a small question, and thought you might
have an idea on it.

I came across the following example that uses the Python Imaging Library
(PIL):

from PIL import Image
img = Image.open('xyz.jpg')

I know that PIL is a module. And, I think that Image is also a module,
especially we are importing it.

I also understood the Image,open() part, as it appears we are using the
method open() from the Image module.

My question is, where did PIL go here? Can a module have another module
inside it?

Thanks.

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

How modules work in Python Abdul Abdul <abdul.sw84@gmail.com> - 2014-11-16 20:36 +0100
  Re: How modules work in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-17 11:24 +1100

csiph-web