print(os.path.isdir("~/.my_dir"))
the command should return True, if exists, and False, if not. Anyways, it returns False if specified folder exists, or does not.
dir = os.path.isdir('/.databases')
dirfile = os.path.exists('~/.databases/database.db')
if (dir == False):
os.system('mkdir ~/.databases')
elif (dir == True):
if dirfile == False:
os.mknod('~/.databases/database.db')
start()
elif dirfile == True:
db = ("~/.databases/database.db")
main(db)
else:
print('Error 1')
else:
print('Error 2')
That's the code i've been trying to fix for now 2 hours. it returns following error:
mkdir: cannot create directory ‘/home/username/.databases’: File exists
Again, the problem is, that the command returns False whenever it needs to be True.