
python
DEPTH2CS
考研中,应该没什么时间解答大家的问题,望理解
展开
-
python中list ,tuple,dict,set的关系以及不可变对象解释(图文详解)
list 1.list可以放进tuple (易知) 2.list可以放入dict作为value,但不可以作为key >>> key = [1, 2, 3] >>> d[key] = 'a list' Traceback (most recent call last): File "<stdin>", line 1, in <mod...原创 2018-08-18 16:27:16 · 1527 阅读 · 0 评论 -
os.path模块
python os.path模块 os.path.abspath(path) #返回绝对路径 os.path.basename(path) #返回文件名 os.path.commonprefix(list) #返回list(多个路径)中,所有path共有的最长的路径。 os.path.dirname(path) #返回文件路径 os.path.exists(path) #路径存在则返回True,...原创 2018-10-23 20:37:39 · 139 阅读 · 0 评论