我尝试使用os来分隔文件夹和文件,但仅当文件(或文件夹)与程序位于同一文件夹中时,os.path.isfile()和os.path.isdir()才返回True。我的代码: if(os.path.exists(".")): # check if the folder exist f main.py
d right 我要在"left“文件夹中
import os os.path.exists("E:/Contact") #Check if dir exist os.mkdir("E:/Contact.strip() conPath = conPath0 + conPath1b + conPath2 os.path.exists.strip()
conPath2 = nam