2

I have defined the string variable

value=“c:/program files/tm su/usr”

I need to use this variable in another string like

Bashcmd=“Override project={value}”

I tried adding the rf option like this

Bashcmd =rf“Override {value}”

But it’s printing only until c:/program, white spaces are neglected. Is there any way to use entire path in Bashcmd and can’t remove spaces in directory path because many system share same paths.

T M Suhas
  • 47
  • 1
  • 6
  • 1
    Does this answer your question? [How to format raw string with different expressions inside?](https://stackoverflow.com/questions/16754594/how-to-format-raw-string-with-different-expressions-inside) – sushanth May 17 '21 at 03:42
  • Refer last answer in the above post, try``Bashcmd = fr“Override {value}”`` – sushanth May 17 '21 at 03:43

1 Answers1

2

You can format strings like this:

value="c:/program files/tm su/usr"
Bashcmd=f"Override project=\"{value}\""

or you can simply concatenate the string like this:

Bashcmd="Override project=\""+value+"\""
pyNeophyte
  • 123
  • 2
  • 9
  • My question was little different,made mistake white editing.I need to pass arguments like project which includes the path of the some folder while executing bash command like project={value} as in my recent edits – T M Suhas May 17 '21 at 04:47