路径(包含文件名):
* * 输出/***/***/***.py
import sys
print(sys.argv[0]) ------F:/Pythontest/untitled0.py
* * 输出\***\***\***.py
import os
print(os.path.realpath(__file__)) ---F:\Pythontest\untitled0.py
* * 输出'\***\***
import os
print(os.getcwd()) ---F:\Pythontest
print(os.path.abspath('.')) ---F:\Pythontest
print(os.path.abspath(os.curdir)) ---F:\Pythontest
路径显示文件名
import os
print(os.path.basename(sys.argv[0])) ----untitled0.py
(print(os.path.dirname(sys.argv[0]))) ----F:/Pythontest