Python获得脚本当前绝对路径的两种方法
方法一:import os path = os.getcwd() print path
方法二:
import os path = os.path.dirname(os.path.abspath(__file__)) print path
import os path = os.getcwd() print path
import os path = os.path.dirname(os.path.abspath(__file__)) print path