What Are These Import/From Statements about?

W

W. Watson

Is there a single source that explains these statements?
------------------------------
from Tkinter import *
from Numeric import *
import Image
import ImageChops
import ImageTk
import time
import binascii
import tkMessageBox
import tkSimpleDialog

from tkFileDialog import asksaveasfilename
from tkFileDialog import askopenfilename

import MakeQTE

import socket
import struct
import glob
import bisect
import os, os.path
import datetime

from os.path import basename, splitext
 
W

W. Watson

While that's an interesting link, I was thinking of the named items like:
Numeric, (this one I know about.)
Image
ImageChops
ImageTk
time
binascii
tkMessageBox
tkSimpleDialog

...
For example, what is the Image module? MakeQTE? ospath?
 
M

Matt McCredie

While that's an interesting link, I was thinking of the named items like:
Numeric, (this one I know about.)
Image
ImageChops
ImageTk
time
binascii
tkMessageBox
tkSimpleDialog

The `image' ones are all part of PIL (Python Imaging Library) which is
a third party module (http://www.pythonware.com/products/pil/). The
others: time, binascii, os.path, tkMessageBox and tkSimpleDialog are
all part of the standard library
(http://docs.python.org/modindex.html). I don't see the documentation
for the tk* ones in the global module index, but you can always look
at the source. I'm not sure what MakeQTE is. If this is a program you
are able to run, you should be able to do something like this:

That will show you where it lives, and you can then look at the source
for more clues.

Also, you should be able to do this:

Which will also likely give you some good clues.

-Matt
 
R

Robert Kern

W. Watson said:
While that's an interesting link, I was thinking of the named items like:

Okay, sorry.
Numeric, (this one I know about.)
Image
ImageChops
ImageTk

The Image* modules are from PIL.
http://www.pythonware.com/products/pil/

These are also from the standard library. See your lib-tk/ directory.
http://effbot.org/tkinterbook/tkinter-standard-dialogs.htm
http://effbot.org/tkinterbook/tkinter-dialog-windows.htm
...
For example, what is the Image module? MakeQTE?

MakeQTE is new to me. Google only brings up this thread.

os.path. It's a sub-module of the standard os module.
http://docs.python.org/lib/module-os.path.html

socket, struct, glob, bisect, and datetime are standard library modules.
http://docs.python.org/modindex.html

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
W

W. Watson

Thanks very much. Where's the global index?

Matt said:
The `image' ones are all part of PIL (Python Imaging Library) which is
a third party module (http://www.pythonware.com/products/pil/). The
others: time, binascii, os.path, tkMessageBox and tkSimpleDialog are
all part of the standard library
(http://docs.python.org/modindex.html). I don't see the documentation
for the tk* ones in the global module index, but you can always look
at the source. I'm not sure what MakeQTE is. If this is a program you
are able to run, you should be able to do something like this:


That will show you where it lives, and you can then look at the source
for more clues.

Also, you should be able to do this:


Which will also likely give you some good clues.

-Matt
 
L

Lawrence D'Oliveiro

os.path. It's a sub-module of the standard os module.

Actually, there are no such things as sub-modules (as you'll find out if you
try to define one). What it really is is a variable in that module, which
points to another module (e.g. posixpath).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top