I want to replace this: path = r'C:/Folder with this: path = r'variable
Where variable is defined elsewhere.
In not sure how to put the variable name after the r'
It can be accomplished for the current session by using the following command, in which directory is the full path of the directory to be entered: PATH="directory:$PATH" For example, to add the directory /usr/sbin, the following would be used: PATH="/usr/sbin:$PATH"
To add a path to the PATH environment variableIn the System dialog box, click Advanced system settings. On the Advanced tab of the System Properties dialog box, click Environment Variables. In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.
This should work:
path = r'%s' % variable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With