Liron Cohen
Liron Cohen

Reputation: 351

Python raw string notation on input from the user

How can i apply raw string notation on input from the user? For exmple, i want to get path from the user and enforce raw string notation on it, so if the input is something like: "\path\the\user\chose" it will be accepted to the raw input / be converted later to r"\path\the\user\chose"

Upvotes: 5

Views: 8180

Answers (1)

time Off
time Off

Reputation: 51

I tried this path = input(r'Input your path:')

It seems that path is something like paht = \path\the\user\chose

By the way, I use Python3.

Upvotes: 4

Related Questions