Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Python by (1.6k points)

How to set the current working directory in Python?

1 Answer

0 votes
by (25.1k points)
edited by

You can use the chdir() method of the os module in python like this:

import os

os.chdir('/path/to/new/directory')

To know more about this you can have a look at the following video:-

Related questions

0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
+3 votes
2 answers

Browse Categories

...