Tithibots / tithiwa

Automate Web WhatsApp with selenium in python.
MIT License
24 stars 22 forks source link

Somehow get the default module directory path and assign that to sessiondir variable as default value #32

Closed NavpreetDevpuri closed 3 years ago

NavpreetDevpuri commented 3 years ago

look at this line it seems incorrect because if the user change folder name then it will create problems.

And add the content SESSIONDIR=something to constants.py and use it.

willidert commented 3 years ago

Can i use os for this issue? I'm implementing it like this: SESSIONDIR=current_local + session_dir current would be os.getcwd() + os.path.join() and session_dir is in the same diretory as the tithiwa.py and the other scripts. Am I right?

NavpreetDevpuri commented 3 years ago

os.getcwd() can be changed and this may create problems in future.

# Now create a new directory
os.mkdir('NewDirectory')
# Change the working directory to the newly created directory
os.chdir('NewDirectory')
# Print the current working directory
print("Current working directory after changing it:")
print(os.getcwd())