#!/usr/bin/python # -*- coding: utf-8 -*- import os #返回脚本所在目录 print os.path.split(os.path.realpath(__file__))[0] #返回脚本文件名称 print os.path.split(os.path.realpath(__file__))[1]
#!/usr/bin/python # -*- coding: utf-8 -*- import os #返回脚本所在目录 print os.path.split(os.path.realpath(__file__))[0] #返回脚本文件名称 print os.path.split(os.path.realpath(__file__))[1]
转载于:https://www.cnblogs.com/dreamer-fish/p/5102367.html