今天爱分享给大家带来Python如何找到当前目录及文件所在目录【面试题详解】,希望能够帮助到大家。
查找当前目录使用os.getcwd()
查找某个文件的目录,使用, os.path
import os.path os.path.realpath(__file__)
原文链接:https://blog.itblood.com/4402.html,转载请注明出处。
今天爱分享给大家带来Python如何找到当前目录及文件所在目录【面试题详解】,希望能够帮助到大家。
查找当前目录使用os.getcwd()
查找某个文件的目录,使用, os.path
import os.path os.path.realpath(__file__)