-1

I am a beginner in Python, I have been reading the book Crash Course Python, the problem comes when I try to run a program from the Python terminal, the command is textual, I just have to put the address of the folder, but I get the error already mentioned, I've been 2 Days trying to see how to fix it but it does not work. the command is C:\> cd Users\Rodrigo\Desktop\python_work

I tried put the command in r"(here is the command)" and C:\\> cd Users\\Rodrigo\\Desktop\\python_work but it doesn`t work

>>> C:\> `cd` Users\Rodrigo\Desktop\python_work
  File "<stdin>", line 1
    C:\> cd Users\Rodrigo\Desktop\python_work
                                            ^
SyntaxError: unexpected character after line continuation character

When I try to use the command r"C:> cd Users\Rodrigo\Desktop\python_work\" just repeat the command as follows 'C:\> cd Users\Rodrigo\Desktop\python_work'

Rink16
  • 138
  • 12
  • `python_work` is a directory that contains the project that you'd like to run? Also you are running this command "from the python terminal". `cd` - change directory - is a system command and is not valid python syntax. You should (1) open the "python terminal" from that directory, (2) use the command prompt to cd into the directory and then run your program from there. What is the output of `which python`? – nick Apr 26 '19 at 05:44

1 Answers1

0

Please add python as environment variable, after installing python in your system.

This Link will solve your problem.

Rink16
  • 138
  • 12