Python change directory error

0 votes

I am trying to change directory in python and am getting an error message:

import os
os.chdir(path=\Users\edenk\)
print(os.getcwd())
File "<ipython-input-1-7efd99e461e0>", line 2
    os.chdir(path=\Users\edenk\)
                                ^
SyntaxError: unexpected character after line continuation character
Jan 8 in Python by digger
• 27,620 points
19 views

1 answer to this question.

0 votes

The syntax of the command you are using to change the directory is wrong. 

To change the directory, follow the below syntax:

os.chdir("/path/to/change/to")
answered Jan 8 by Omkar
• 67,120 points

Related Questions In Python

+2 votes
6 answers

How can I change directory or "cd" in Python?

Context Manager: cd import os class cd:     """Context manager for ...READ MORE

answered Oct 18, 2018 in Python by Nabarupa
73 views
0 votes
1 answer

Know/change current directory in Python shell?

This will work  >>> import os >>> os.getcwd() '/home/user' >>> os.chdir("/tmp/") >>> ...READ MORE

answered Nov 12, 2018 in Python by Priyaj
• 56,160 points
24 views
+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

answered Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
61 views
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
57 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 127 views
+4 votes
6 answers
0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 67,120 points
964 views
0 votes
2 answers