[Tutor] RE...Quest from PRJoshi

Pravin Raj Joshi prjoshi@ntc.net.np
Sat, 29 Dec 2001 07:05:35 +0530


Hi,
Here is a small problem again.
I have two classes. Below are the codes and the file names.

#---------------------------------------------------------
trailabout.py
#---------------------------------------------------------
from Tkinter import *

class abouttrail:
    def __init__(self,root=None):
        self.frame = frame = Frame(root)
        self.button = button = Button(frame,text="Press")
        frame.pack()
        button.pack()

def trail():
    root = Tk()
    mainwin = abouttrail(root=root)
    root.mainloop()

if __name__ == '__main__':
    trail()


#-------------------------------------------------------
test.py
#-------------------------------------------------------
from Tkinter import *
from trailabout import abouttrail

root = Tk()
mainwin = abouttrail(root=root)
root.mainloop()
-------------------------------------------------------

I have both the files in the following path: c:\python\nepali_converter\
When I compile them from outside Idle (using command-line interpreter) they
work perfect, but from inside Idle here is the message I get and the program
fails. I am using the one that comes with Python 2.2.

#------------------------------------------------------
>>>
Traceback (most recent call last):
  File "C:\Python\nepali_converter\test.py", line 2, in ?
    from trailabout import abouttrail
ImportError: No module named trailabout
#------------------------------------------------------

Could anyone let me know what is wrong.

Thanks.

PRJoshi