943,969 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 405
  • Python RSS
Oct 31st, 2009
0

update namespace

Expand Post »
Here's my problem. I wx application that works great until I close it (leaving the idle editing session open) and then restart it. Then parts of the program see variables that should be things like 'wx.panel' as PyDeadObj .... Once I restart the idle session and re-run the program it works fine. I've tried reload(wx), I've tried deleting all wx variables from sys.modules ... Any more ideas?
Reputation Points: 33
Solved Threads: 8
Junior Poster
ihatehippies is offline Offline
154 posts
since Oct 2008
Nov 1st, 2009
0
Re: update namespace
Are you running this from the Python shell?
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Nov 3rd, 2009
0
Re: update namespace
Click to Expand / Collapse  Quote originally posted by vegaseat ...
Are you running this from the Python shell?
Yes. It works fine as a standalone as well.
Reputation Points: 33
Solved Threads: 8
Junior Poster
ihatehippies is offline Offline
154 posts
since Oct 2008
Nov 3rd, 2009
0
Re: update namespace
Here's my problem. I wx application that works great until I close it (leaving the idle editing session open) and then restart it.
Your real problem is that you're using IDLE.

Your best bet is to switch to a better-featured (not to mention better-designed) IDE and run your scripts directly using python.exe or pythonw.exe

I suggest something like PyScripter or NotePad++ (although with the latter you'll have to do your own personalization to get Python setup and have the ability to syntax check, run scripts, etc.)
Reputation Points: 355
Solved Threads: 292
Veteran Poster
jlm699 is offline Offline
1,102 posts
since Jul 2008
Nov 3rd, 2009
0
Re: update namespace
I noticed before that if you work in the shell with some IDEs, then you seem to retain old variables. Check the global dictionary in the shell. I would say avoid the shell with any programs larger than 2 lines.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Nov 3rd, 2009
0
Re: update namespace
I appreciate both comments. I'll check out pyscripter and I'll look over the globals again. It just seems weird to me that the old variables don't get overwritten at next run.
Reputation Points: 33
Solved Threads: 8
Junior Poster
ihatehippies is offline Offline
154 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: File to dictionary
Next Thread in Python Forum Timeline: problem with some functions





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC