Python File Directory

  • python

posted on 26 Feb 2018 under category 人生经验

/test/sub/sub_path.py

获取sub_path.py所在目录正确方法:

os.path.split(os.path.realpath(__FILE__))[0]

参考