Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Cammy And
Added: Jun 24, 2021 2:09 AM
Views: 37
Tags: no tags
  1. import os, sys
  2. abspath = os.path.abspath(sys.argv[0])
  3. dname = os.path.dirname(abspath)
  4. os.chdir(dname)