<div dir="ltr">On Mon, Aug 25, 2008 at 3:48 PM, Gopal Ghosh <span dir="ltr"><<a href="mailto:gopalmessages@gmail.com">gopalmessages@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I created a script – myscript.py and saved it at c:\myscript.py<br>
*******<br>
myscript.py contains the following commands<br>
a=1000<br>
2**8<br>
print 'hello world'<br>
raw_input( ) # what this command does???<br>
******<br>
now I tried to call the script from<br>
IDLE<br>
>>>myscript.py<br>
(not working from IDLE) got the error<br>
Traceback (most recent call last):<br>
File "<pyshell#30>", line 1, in <module><br>
power.py<br>
NameError: name 'power' is not defined<br>
RUN<br>
c:\myscript.py<br>
(working from RUN)<br>
Python CLI – called by typing python at run prompt<br>
>>>myscript.py<br>
(not working from Python CLI) again got the same error as in IDLE<br>
******************************************************<br>
now I tried to run the script in a different way<br>
IDLE<br>
>>>myscript.py > saveit.txt<br>
(not working from IDLE) got the following error<br>
Traceback (most recent call last):<br>
File "<pyshell#29>", line 1, in <module><br>
power.py > saveit.txt<br>
NameError: name 'power' is not defined<br>
RUN<br>
c:\myscript.py<br>
(working from RUN – but don't know where to locate saveit.txt)<br>
Python CLI – called by typing python at run prompt<br>
>>>myscript.py<br>
(not working from Python CLI) got the same eror as in IDLE<br>
******************************************************<br>
_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
</blockquote></div><br>Hi<br>
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.<br>
<br>
raw_input() takes a raw string as input from the console. more info at <a href="http://docs.python.org/lib/built-in-funcs.html#l2h-59">http://docs.python.org/lib/built-in-funcs.html#l2h-59</a><br>
<br>
Cheers<br clear="all"><br>-- <br>Abhinav Sarkar<br>Fair Isaac India<br><br>Mobile:+91-9731596137<br>Office: +91-8041371605<br><br>Web: <a href="http://claimid.com/abhin4v">http://claimid.com/abhin4v</a><br>Twitter: <a href="http://twitter.com/abhin4v">http://twitter.com/abhin4v</a><br>
---------<br>The world is a book, those who do not travel read only one page.<br>
</div>