这是当前代码:
if message.content == "MMO start":
dir=(r"C:\\Users\\User\Desktop\MMMOProfiles")
file = str(message.author)
path = os.path.join(dir,file)
isExist = os.path.exists(path)
if isExist == True:
await message.channel.send("You already have a profile")
elif isExist == False:
await message.channel.send("Creating profile")
file2 = str(message.author)
dir =(r"C:\\Users\\User\Desktop\MMOProfiles")
os.mkdir(file2)
当我试图让它创建文件夹,虽然它在桌面上,而不是在桌面上的文件夹
此代码将检查桌面中的文件夹是否存在,如果没有,将创建新文件夹:
相关问题 更多 >
编程相关推荐