Your code is actually a definition of a new_directory
function. It won't be executed unless you make a call to new_directory()
.
So, when you want to execute the code from your post, just add a function call like this:
def new_directory():
if not os.path.exists(current_sandbox):
os.mkdir(current_sandbox)
new_directory()
Not sure if that's the behavior you expect to get.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…