Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- print(os.getcwd())
- D:testtool
- c:Python33>python D:testtoolcurrent_dir.py
- c:Python33
- import os
- os.chdir(os.path.dirname(__file__))
- print(os.getcwd())
- import pathlib
- current_dir = pathlib.Path(__file__).parent
- current_file = pathlib.Path(__file__)
Add Comment
Please, Sign In to add comment