Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Path in Variable with r'

Tags:

python

path

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'

like image 799
Dance Party Avatar asked Feb 04 '15 05:02

Dance Party


People also ask

What is path =$ path?

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"

How do I include a PATH variable?

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.


1 Answers

This should work:

path = r'%s' % variable
like image 80
Jessamyn Smith Avatar answered Sep 21 '22 22:09

Jessamyn Smith