Two Simple Qs:

Bjorn Pettersen BPettersen at NAREX.com
Tue Jul 17 20:37:39 CEST 2001


> From: newgene [mailto:newgene at bigfoot.com]
> 
> I am quite new to python. I have 2 simple questions:
> 
> 1. How can I run a simply Python script under IDLE directly? I wrote a
> start.py to do some routine work, like importing some medules and
> adding my working path into sys.path, before I start to work. This
> script is just like a macro or batch file under DOS. Now I have to
> open this file and then run it. I hope python have a statement can run
> it directly( maybe like 'run start.py').

try "import start.py"

> 2. When I made some modification of my own module after I import this
> module,python can not recognized the modified module even I import it
> again. It raised the same error msg, but gave me the error line
> actually I have corrected, that is , it run as the old module but
> display the error from the newer module file. I have to restart python
> environment and import again, then my module run correctly. Is this a
> bug? And how to resolve it?

Not quite clear what you're asking here, but try "reload(myModule)"

hth,
-- bjorn




More information about the Python-list mailing list