I'm trying to make a python package and I want to take input from the user and save the info in a .example
folder in the root directory so that I can access that info later. This is what I implemented but it's not working -
def root_path():
return os.path.abspath(os.sep)
if os.path.isdir(os.path.join(root, ".example")):
#get info
else:
#create .example in root
I want this to work on all operating system (Linux, MacOs and Windows majorly).
Does the isdir()
function not work with hidden directories? What is the right way to do this?