testing code

Sharan Basappa sharan.basappa at gmail.com
Sun Jul 8 08:32:31 EDT 2018


On Sunday, 8 July 2018 12:42:07 UTC+5:30, Christian Gollwitzer  wrote:
> Am 08.07.18 um 06:21 schrieb Sharan Basappa:
> > sorry. there was a copy paste error when i posted. I pasted test_2.py for both the files:
> > 
> > here are the files again. The issue remains.
> 
> > output:
> > %run "D:/Projects/Initiatives/machine learning/programs/test_2_test.py"
> > 30
> > 
> 
> Jim spotted it... '%run' is in IPython, right? "import" statements are 
> executed only once for a given module (that's the purpose) - you have 
> probably modified your imported file, and not restarted the interpreter. 
> The second time you then import it, nothing happens.
> 
> If you restart your interpreter, you should see both lines printed.
> 
> 	Christian

yes, exactly. this is the issue although execution is in Canopy and not in iPython



More information about the Python-list mailing list