Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: M. Chris
Added: Apr 24, 2019 9:07 AM
Views: 5
Tags: no tags
  1. #If you mean the directory of the script being run:
  2. import os
  3. os.path.dirname(os.path.abspath(__file__))
  4.  
  5.  
  6. #If you mean the current working directory:
  7.  
  8. import os
  9. os.getcwd()