update namespace

Reply

Join Date: Oct 2008
Posts: 57
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
22 Days Ago
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: 3,952
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: 916
Moderator
vegaseat's Avatar
vegaseat vegaseat is online now Online
DaniWeb's Hypocrite
 
0
  #2
21 Days Ago
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: 57
Reputation: ihatehippies is an unknown quantity at this point 
Solved Threads: 0
ihatehippies ihatehippies is offline Offline
Junior Poster in Training
 
0
  #3
20 Days Ago
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,041
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: 261
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is
 
0
  #4
20 Days Ago
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: 3,952
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: 916
Moderator
vegaseat's Avatar
vegaseat vegaseat is online now Online
DaniWeb's Hypocrite
 
0
  #5
20 Days Ago
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: 57
Reputation: ihatehippies is an unknown quantity at this point 
Solved Threads: 0
ihatehippies ihatehippies is offline Offline
Junior Poster in Training
 
0
  #6
19 Days Ago
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



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC