Skip to content
Advertisement

Python variable file path and string prefixes

Using tkinter to select output folder for processed files.

JavaScript

Would like to use file_output and x as variables for my file path, My attempt:

JavaScript

This does not work in my program. The output I need is

JavaScript

I am reading the docs https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-stringprefix

Still don’t understand how to escape or a workaround, Help would be much appreciated.

Advertisement

Answer

you can easily use replace to get the output you want, so try this:

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement