I want to check if a file exists and if it does give the folder i create with mkdir
the next higher number.
Somehow I get the Error: AttributeError: 'module' object has no attribute 'exist'
I do not understand why that os function does not work for me. Any ideas?
import os
map_name="Example.png"
wk_dir = os.path.dirname(os.path.realpath('__file__'))
dir_name=os.path.splitext(os.path.basename(map_name))[0]
for n in range(0,200):
m=n+1
if os.path.exist(wk_dir + "/" + dir_name + "_%s_%dx%d_%d" % (a, resolution, resolution,n)):
os.mkdir(wk_dir + "/" + dir_name + "_%s_%dx%d_%d" % (a, resolution, resolution,m))
break