I have worked through the entire tutorial and when I try to run the application I get this error:
name 'dlg' is not defined
line 101 dlg.destroy()
I am not sure why I get this error, my code looks exactly like the tutorial.
If you post your code it would be easier to help (no guarantee so!).
The easiest is if you post as an attachment on this boa newsgroup
I was not able to find any help in the forum you suggested. Here is the block of code that is giving me the problem::
def OnMnuFileItems0Menu(self, event):
dlg = wxFileDialog(self, "Choose a file", ".", "", "*.*", wxOPEN)
if dlg.ShowModal() == wxID_OK:
filename = dlg.GetPath()
I am new to python so I very well could be missing something, but I followed the tutorial exactly.
I can only guess that you have an indentation problem, I think your try/finally block is NOT on the correct level.
Python is very sensitive, in my view actually a good thing, as it forces everyone to indent things correctly. Makes it easier to read a program and forces some consitency.
I will post a small file on gmane newsgroup - won't do it here because sourceforge does strange things to indentation.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.