Answer the question
In order to leave comments, you need to log in
How to put a filename into a variable via Python3?
Good afternoon. It is required to enter the file name into the variable. For example: there is a video file, I am manipulating it and the modified file must be named: original name + postscript, so I need to drive the name of the source file into a variable, so that later I can use it to name the changed one, the name needs to be saved without extension. How to do it?
Answer the question
In order to leave comments, you need to log in
>>> filename = input("Input filename: ")
Input filename: filename
>>> filename
'filename'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question