Put a print statement around
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,
If you want to read/write file, use
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.
os.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, use
open(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.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!