import os
directory=input("Directory: ")
if not os.path.exists(directory):
os.mkdir(directory)
os.mkdir(str(directory)+'\steamCMD')
os.mkdir(str(directory)+'\temporary')
A snippet from my code. Returns OSError on the last line shown here. Why? Does exactly same thing as 5th line yet 5th line works like a charm. Error:
os.mkdir(str(directory)+'\temporary')
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'c:\\testing\temporary'
Similar: Python - os.rename() - OSError: [WinError 123] os.mkdir(path) returns OSError when directory does not exist However he had different mistake to me. Anyone tell me why this is happen?