Skip to content

Instantly share code, notes, and snippets.

@PeterBlaho
Last active April 26, 2020 16:18
Show Gist options
  • Save PeterBlaho/be7c7f266f739edc9b243e9145cddb5f to your computer and use it in GitHub Desktop.
Save PeterBlaho/be7c7f266f739edc9b243e9145cddb5f to your computer and use it in GitHub Desktop.
[Working directory] Set working directory. #Python #OS
'''
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