Last active
April 26, 2020 16:18
-
-
Save PeterBlaho/be7c7f266f739edc9b243e9145cddb5f to your computer and use it in GitHub Desktop.
[Working directory] Set working directory. #Python #OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
The working directory is automatically set to the directory from which I run the Python script. | |
''' | |
import os | |
os.chdir(r"C:\Users\peter\OneDrive\Programing\Python\MyApps\NLTK") #It changes the current working directory only. | |
print(os.getcwd()) #C:\Users\peter\OneDrive\Programing\Python\MyApps\NLTK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment