需要导入OS模块。
判断C:\有没有test目录。
如果不存在则建立一个,代码如下:
import osif not os.path.exists(r"C:\test"): os.mkdir(r"C:\test")
os.path.isdir(..)