change my python working directory

Solutions on MaxInterview for change my python working directory by the best coders in the world

showing results for - "change my python working directory"
Nabil
28 Jun 2020
1# Import the os module
2import os
3
4# Print the current working directory
5print("Current working directory: {0}".format(os.getcwd()))
6
7# Change the current working directory
8os.chdir('/tmp')
9
10# Print the current working directory
11print("Current working directory: {0}".format(os.getcwd()))
12