[BangPypers] unable to figure out the ways to run a module

Anand Balachandran Pillai abpillai at gmail.com
Mon Aug 25 12:35:01 CEST 2008


Not really. He is trying to actually run a Python script
by name from IDLE prompt....

To run myscript.py, he is opening IDLE and giving
myscript.py at the IDLE Python prompt...

To Gopal: Please go through the Python tutorial online
at http://www.python.org/doc/current/tut/tut.html, before
posting here. You have basic newbie issues with Python
and the tutorial is the best way for learning the ropes
by yourself.

--Anand

On Mon, Aug 25, 2008 at 3:59 PM, abhinav sarkar
<abhinav.sarkar at gmail.com> wrote:
> On Mon, Aug 25, 2008 at 3:48 PM, Gopal Ghosh <gopalmessages at gmail.com>
> wrote:
>>
>> I created a script – myscript.py and saved it at c:\myscript.py
>> *******
>> myscript.py contains the following commands
>> a=1000
>> 2**8
>> print 'hello world'
>> raw_input( ) # what this command does???
>> ******
>> now I tried to call the script from
>> IDLE
>> >>>myscript.py
>> (not working from IDLE) got the error
>> Traceback (most recent call last):
>>  File "<pyshell#30>", line 1, in <module>
>>    power.py
>> NameError: name 'power' is not defined
>> RUN
>> c:\myscript.py
>> (working from RUN)
>> Python CLI – called by typing python at run prompt
>> >>>myscript.py
>>  (not working from Python CLI) again got the same error as in IDLE
>> ******************************************************
>> now I tried to run the script in a different way
>> IDLE
>> >>>myscript.py > saveit.txt
>> (not working from IDLE) got the following error
>> Traceback (most recent call last):
>>  File "<pyshell#29>", line 1, in <module>
>>    power.py > saveit.txt
>> NameError: name 'power' is not defined
>> RUN
>> c:\myscript.py
>> (working from RUN – but don't know where to locate saveit.txt)
>> Python CLI – called by typing python at run prompt
>> >>>myscript.py
>>  (not working from Python CLI) got the same eror as in IDLE
>> ******************************************************
>> _______________________________________________
>> BangPypers mailing list
>> BangPypers at python.org
>> http://mail.python.org/mailman/listinfo/bangpypers
>
> Hi
> I think you are using an older version of python which doesn't support the
> exponential operation (2**8). The code provided by you work in my python
> prompt.
>
> raw_input() takes a raw string as input from the console. more info at
> http://docs.python.org/lib/built-in-funcs.html#l2h-59
>
> Cheers
>
> --
> Abhinav Sarkar
> Fair Isaac India
>
> Mobile:+91-9731596137
> Office: +91-8041371605
>
> Web: http://claimid.com/abhin4v
> Twitter: http://twitter.com/abhin4v
> ---------
> The world is a book, those who do not travel read only one page.
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
>



-- 
-Anand


More information about the BangPypers mailing list