【Python爬虫】os.path方法

经常使用方法 做用 os.path.dirname(file) 返回当前python执行脚本的执行路径(看下面的例子),这里file为固定参数 os.path.abspath(file) 返回一个文件在当前环境中的绝对路径,这里file 一参数 os.path.join(basedir,file) 把目录和文件名合成一个路径 os.path.dirname(path) 返回文件路径 os.path
相关文章
相关标签/搜索