set path=%path%;C:\python27 where does this code go?
please explain in detail?

Go to www.google.com and type 'set the path in windows 7' (or vista, or XP, etc). Follow the instructions of one of the first links on how to set the path in windows. Once you're at the step of editing the path, simply add ;C:\python27 to your path. Do this in an administrator account if possible.

Okay when I have set the environment variable but the following error occurs when I try running python in command prompt.

C:\Users\Shankaranarayanan>cd DESKTOP

C:\Users\Shankaranarayanan\Desktop>cd MY COMPUTER
The system cannot find the path specified.

C:\Users\Shankaranarayanan\Desktop>cd My Computer
The system cannot find the path specified.

C:\Users\Shankaranarayanan\Desktop>cd MyComputer
The system cannot find the path specified.

C:\Users\Shankaranarayanan\Desktop>cd Computer
The system cannot find the path specified.

C:\Users\Shankaranarayanan\Desktop>cd Computer\
The system cannot find the path specified.

C:\Users\Shankaranarayanan\Desktop>cd C:\

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

C:\>cd python32\

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

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

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

C:\Python32>python
Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> python--version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
>>> cd

I'm not sure what to do now or where the problem lies?

This is what im facing when I try to run the python interactively from the command prompt:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Shankaranarayanan>cd\

C:\>python
Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello"
File "<stdin>", line 1
print "hello"
^
SyntaxError: invalid syntax
>>>


is this a problem with the way environment variables are set??
IF so can someone give me the step by step method to set them as i deleted them by mistake!

This is what im facing when I try to run the python interactively from the command prompt:

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Shankaranarayanan>cd\

C:\>python
Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello"
File "<stdin>", line 1
print "hello"
^
SyntaxError: invalid syntax
>>>


is this a problem with the way environment variables are set??
IF so can someone give me the step by step method to set them as i deleted them by mistake!

In principle, you don't need to cd to python's folder to invoke the command 'python' if C:\Python32 is in your PATH variable. Also I don't understand why in first post it was C:\Python27...

Your python statement fails because the 'print' statement became a function in python 3.0. So now, you must write

print("hello")

with parenthesis. I understand that you're a python beginner, so use a tutorial for python 3.x and not python 2.x. There are not so many differences, but 'print' is one of them. Also, please use code tags when you post code in the forum. Read this http://www.daniweb.com/software-development/python/threads/366794 and this http://www.daniweb.com/forums/announcement.php?f=8&announcementid=3

Edited 5 Years Ago by Gribouillis: n/a

This question has already been answered. Start a new discussion instead.