[Tutor] New member question

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 28 Jul 2002 12:23:44 -0700 (PDT)


> But if I make a small module and try to open it, the program can't find
> it.  I am suspecting this problem is an issue concerning PYTHONPATH, but
> I'm not sure.  I have read news lists and tutor information and o'reilly
> "learning python", but ALL those sources given answers using concepts
> rather more sophisticated than my actual question.  Any help would be
> greatly appreciated.

That's odd!  Hmmm... I think we might need more information on this one.
How are you trying to open the module?


If you keep all your modules in a standard place, you can add the
environmental variable 'PYTHONPATH', so that Python knows about them.
For example, on my Linux system, I keep a personal directory of modules in
a directory called '/home/dyoo/src/python'.  My PYTHONPATH will look like:

    PYTHONPATH='/home/dyoo/src/python'

and that should be it; afterwards, I can do an 'import
[name-of-my-module]' statement in other programs, and it should import the
module ok.



> Also, what is tkinter and does it come with this distribution?  I can't
> find it, but thought it came with the download from python.org.

Tkinter is a module that provides GUI building support.  You can write
programs that open windows and bring up buttons and menus.  It should be
installed alongside Python if you're using the standard distribution from
Python.org.

If you'd like to read a little more on Tkinter, Fredrik Lundh's "An
Introduction to Tkinter" may whet your appetite:

    http://www.pythonware.com/library/tkinter/introduction/


There are other GUI toolkits available for Python; although Tkinter is
standard, another popular one is called "wxPython":

    http://www.wxpython.org/

I have to admit that I haven't tried wxPython yet, but other people on
this list may be able to share their experiences with it.


If you have more questions, please feel free to ask.  We'll be happy to
help!  Off to lunch for me.  *grin* I'll talk to you later!