Jul-13-2019, 03:11 AM
I often see tutorials (mostly) demo of OS Module and every IO module with static addresses/path(s). But how about if we send our script to our friend, when he/she run the script, it won't work since "c:\\User\\"Isn't the same account\\" so the path breaks.
How can we create a dynamic path/address, were the script would identify the User's Account name and would not break the path. Do I also need to use RegEx? If so, some directory hierarchy isn't the same in count, and in-turn with also break the code again, right?
Also, what if I found a way with the said problem above, trying to use
How can we create a dynamic path/address, were the script would identify the User's Account name and would not break the path. Do I also need to use RegEx? If so, some directory hierarchy isn't the same in count, and in-turn with also break the code again, right?
Also, what if I found a way with the said problem above, trying to use
os.chdir('supplemental_directory')to make it easier but after Python reads that line, it would now be in the 'supplemental_directory', right?