I have downloaded Anygui.
I am using Python Win on XP operating sys.
I am learning Python; self-teaching myself from the Practical Python
book.
I am having problems implementing the app = Application( )
I get the following error:
Traceback (most recent call last):
File
"C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py"
, line 310, in RunScript
exec codeObject in __main__.__dict__
File "C:\Documents and Settings\M&I\My Documents\Python Programs\Gui
test.py", line 2, in ?
app = Application()
NameError: name 'Application' is not defined
This is my Python Script:
from anygui import *
app = Application()
win = Window(title='Simple Editor')
app.add(win)
loadButton = Button(text='open me', height=25)
win.add(loadButton, right=5, top=5, hmove=1)
saveButton = Button(text='keep me', height=25)
win.add(saveButton, right=(loadButton, 10), top=5, hmove=1)
filename = TextField(height=25)
win.add(filename, right=(saveButton, 10), top=5, left=5, hstretch=1)
contents = TextArea()
win.add(contents, top=(filename, 5), left=5, right=5, bottom=5,
hstretch=1, vstretch=1)
def load(event):
file = open(filename.text)
contents.text = file.read()
file.close()
link(loadButton, load)
def save(event):
file = open(filename.text, 'w')
file.write(contents.text)
file.close()
link(saveButton, save)
app.run()
I had this issue before and I reinstalled Anygui. It seemed to help,
but in the middle of my work, after successfully creating my 'box',
I ran it again and I received the above error.
Please Help. is it just me. am I missing something. lol; Thank you
Monica.
|