Grokbase Groups Python tutor May 2011
FAQ
C:\>python hello.py

'python' is not recognized as an internal or external command,
operable program or batch file.

C:\>cd python26

C:\Python26>python
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
python hello.py
? File "<stdin>", line 1
? ? python hello.py
? ? ? ? ? ? ? ?^
SyntaxError: invalid syntax
python
Traceback (most recent call last):
? File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
>>>

Above is the snapshot of the error.
M running Windows 7 Home Premium, OS: NT
Have??;C:\Python26 added to?the?PATH variable?, still unable to execute any file :( same error.

Please help!! Thanks in advance..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110519/308f0be8/attachment.html>

Search Discussions

  • James Reynolds at May 19, 2011 at 8:21 pm
    You're in the python interpreter.

    Hit control C to go back to cmd and then you can do "python hello.py"
    On Thu, May 19, 2011 at 4:14 PM, Neha P wrote:

    C:\>python hello.py
    'python' is not recognized as an internal or external command,
    operable program or batch file.

    C:\>cd python26

    C:\Python26>python
    Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
    (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    python hello.py
    File "<stdin>", line 1
    python hello.py
    ^
    SyntaxError: invalid syntax
    python
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'python' is not defined
    Above is the snapshot of the error.
    M running Windows 7 Home Premium, OS: NT
    Have ;C:\Python26 added to the PATH variable , still unable to execute
    any file :( same error.

    Please help!! Thanks in advance..




    _______________________________________________
    Tutor maillist - Tutor at python.org
    To unsubscribe or change subscription options:
    http://mail.python.org/mailman/listinfo/tutor
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/tutor/attachments/20110519/c6cf3012/attachment-0001.html>
  • Noah Hall at May 19, 2011 at 8:36 pm

    On Thu, May 19, 2011 at 9:14 PM, Neha P wrote:
    C:\>python hello.py
    'python' is not recognized as an internal or external command,
    operable program or batch file.
    This happens because "python.exe" is not in the system path.
    C:\>cd python26
    C:\Python26>python
    Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
    on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    python hello.py
    ? File "<stdin>", line 1
    ? ? python hello.py
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    Now, this happens because you're in the python interpretor. Calling
    python.exe will do this, unless you provide it with a file to
    interpret. When you run this, you're already in the interpretor. Even
    if it did work, it wouldn't because hello.py isn't in the path, unless
    you've saved it to C:\Python26 or the location you've saved it to is
    in the path.
    python
    Traceback (most recent call last):
    ? File "<stdin>", line 1, in <module>
    NameError: name 'python' is not defined
    Again, see above.
    Above is the snapshot of the error.
    M running Windows 7 Home Premium, OS: NT
    Have??;C:\Python26 added to?the?PATH variable?, still unable to execute any
    file :( same error.
    Please help!! Thanks in advance..
    Ah. Well, did you click OK to save it, then restart your shell? If you
    did, try "echo %PATH%" if you're using cmd, or "$env:Path" if you're
    using Powershell, and paste the output here.
  • Neha P at May 19, 2011 at 8:40 pm
    Hey all, got the solution...
    Thanks for the help :) :)
    Just needed to from?
    C:\Python26>Python hello.py
    Its working fine...


    ________________________________
    From: Neha P <mywrkid at yahoo.com>
    To: "tutor at python.org" <tutor at python.org>
    Sent: Thursday, May 19, 2011 4:14 PM
    Subject: [Tutor] Error in executing 'Python Filename.py'.


    C:\>python hello.py

    'python' is not recognized as an internal or external command,
    operable program or batch file.

    C:\>cd python26

    C:\Python26>python
    Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    python hello.py
    ? File "<stdin>", line 1
    ? ? python hello.py
    ? ? ? ? ? ? ? ?^
    SyntaxError: invalid syntax
    python
    Traceback (most recent call last):
    ? File "<stdin>", line 1, in <module>
    NameError: name 'python' is not defined
    >>>

    Above is the snapshot of the error.
    M running Windows 7 Home Premium, OS: NT
    Have??;C:\Python26 added to?the?PATH variable?, still unable to execute any file :( same error.

    Please help!! Thanks in advance..



    _______________________________________________
    Tutor maillist? -? Tutor at python.org
    To unsubscribe or change subscription options:
    http://mail.python.org/mailman/listinfo/tutor
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/tutor/attachments/20110519/9c4027cb/attachment.html>

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouptutor @
categoriespython
postedMay 19, '11 at 8:14p
activeMay 19, '11 at 8:40p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase