update namespace

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2008
Posts: 58
Reputation: ihatehippies is an unknown quantity at this point 
Solved Threads: 0
ihatehippies ihatehippies is offline Offline
Junior Poster in Training

update namespace

 
0
  #1
Oct 31st, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,109
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 943
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite
 
0
  #2
Nov 1st, 2009
Are you running this from the Python shell?
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 58
Reputation: ihatehippies is an unknown quantity at this point 
Solved Threads: 0
ihatehippies ihatehippies is offline Offline
Junior Poster in Training
 
0
  #3
Nov 3rd, 2009
Originally Posted by vegaseat View Post
Are you running this from the Python shell?
Yes. It works fine as a standalone as well.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,064
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 268
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is
 
0
  #4
Nov 3rd, 2009
Originally Posted by ihatehippies View 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.
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.)
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,109
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 943
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite
 
0
  #5
Nov 3rd, 2009
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.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 58
Reputation: ihatehippies is an unknown quantity at this point 
Solved Threads: 0
ihatehippies ihatehippies is offline Offline
Junior Poster in Training
 
0
  #6
Nov 3rd, 2009
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.
Reply With Quote Quick reply to this message  
Reply

Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC