Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
1 view
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
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...