How do you get a file name from command line when you run a Python code? Like if your code opens a file and reads the line, but the file varies whenever you run it, how to y
Just use the basic command raw_input
raw_input
declare input file name as string
inFile = "" inFile = raw_input("Enter the input File Name: ")
Now you can open the file by using with open(inFile,'w')
open(inFile,'w')