469,077 Members | 1,415 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

Facing problems with active python access

440 256MB
Hi,

Currently I am using Active Python 2.4.2 IDLE.I am facing the following issue.

- When I modify the code in different modules and execute the main module ,and if any error is coming in some module and if I fix that error.Even then the same error is displayed in the "Interactive Window".To get rid of this error I have to close the IDLE and open again the Main module to execute the application,then the error gets disappear.

I dont understand why this kind of different with this IDLE.

Has any active python users are also facing the same issues in the beginning.

Could anybody help me in fixing this.

Thnaks in advance
PSB
Mar 23 '07 #1
5 1403
bvdet
2,851 Expert Mod 2GB
Hi,

Currently I am using Active Python 2.4.2 IDLE.I am facing the following issue.

- When I modify the code in different modules and execute the main module ,and if any error is coming in some module and if I fix that error.Even then the same error is displayed in the "Interactive Window".To get rid of this error I have to close the IDLE and open again the Main module to execute the application,then the error gets disappear.

I dont understand why this kind of different with this IDLE.

Has any active python users are also facing the same issues in the beginning.

Could anybody help me in fixing this.

Thnaks in advance
PSB
Use the reload() function. When Python sees that a module is loaded into memory, it does not import the module again.
Mar 23 '07 #2
psbasha
440 256MB
Use the reload() function. When Python sees that a module is loaded into memory, it does not import the module again.
Could you please provide me a sample piece of code.


Thanks
PSB
Mar 23 '07 #3
bvdet
2,851 Expert Mod 2GB
Could you please provide me a sample piece of code.


Thanks
PSB
Expand|Select|Wrap|Line Numbers
  1. >>> reload(re)
  2. Traceback (most recent call last):
  3.   File "<interactive input>", line 1, in ?
  4. NameError: name 're' is not defined
  5. >>> import re
  6. >>> reload(re)
  7. <module 're' from 'C:\Python23\lib\re.pyc'>
  8. >>> 
Mar 23 '07 #4
psbasha
440 256MB
How to import my own module by reload() method.

Say:

from Sample import CSample


"Sample" is a python file "Sample.py".

"CSample" is a class name in "Sample.py"

Thanks
PSB
Apr 12 '07 #5
bvdet
2,851 Expert Mod 2GB
How to import my own module by reload() method.

Say:

from Sample import CSample


"Sample" is a python file "Sample.py".

"CSample" is a class name in "Sample.py"

Thanks
PSB
reload() is typically only used for debugging. To reload a module, you must use fully qualified names, eg:
import Sample

x = Sample.CSample()

reload(Sample)
Apr 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Robert Brewer | last post: by
reply views Thread by Jeff Epler | last post: by
reply views Thread by Kyle Harrigan | last post: by
1 post views Thread by Harlin Seritt | last post: by
2 posts views Thread by Sharon | last post: by
1 post views Thread by Joanne | last post: by
3 posts views Thread by KimberlyM | last post: by
4 posts views Thread by =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?= | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.