python 之 os.path.basename() 和 os.sep()

2、os.sep() 

由于python在 windows 和 Linux 系统都是可运行的,在 windows 中路径分隔符是 ‘\’,但在 Linux 中是 ‘/’ ,

用法:更改操作系统中的分隔符,常用于路径分隔

返回:适应于当前系统的路径

猜你喜欢

转载自blog.csdn.net/weixin_42338058/article/details/83868798
今日推荐