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
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,850 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
50 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,120 points
14 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
33 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
46 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
25 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
• 65,850 points
673 views
0 votes
1 answer

Python error "NameError: name 'sr' is not defined"

I guess you are using speech_recognition module and missing ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 65,850 points
1,810 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.