Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import os
  2. print(os.getcwd())
  3.  
  4. D:testtool
  5.  
  6. c:Python33>python D:testtoolcurrent_dir.py
  7. c:Python33
  8.  
  9. import os
  10. os.chdir(os.path.dirname(__file__))
  11. print(os.getcwd())
  12.  
  13. import pathlib
  14.  
  15. current_dir = pathlib.Path(__file__).parent
  16. current_file = pathlib.Path(__file__)
Add Comment
Please, Sign In to add comment