Feb-18-2018, 03:20 PM
(This post was last modified: Feb-18-2018, 03:28 PM by SteampunkMaverick12.)
(Feb-17-2018, 06:02 PM)DeaD_EyE Wrote: Put a print statement aroundos.getcwd()
def make_file(): print('Current working directory', os.getcwd()) os.chdir('export') os.mkdir(str(name.get()))Execute the program and look in which current working directory your program is running.
Look if you can reach from this path 'export'. I think your cwd is at a different path
as the directory 'export'.
By the way,os.mkdir
makes a directory, not a file.
If you want to read/write file, useopen(filepath)
.
After you've understood the old school os.path and the difference between relative and absolute paths, you should take a look into the pathlib module.
its supposed to be a folder
i am trying to make a program that makes a folder. Then you can make and save files in the folder. Its supposed to b a game modding program