Skip to content
How can I open a file based on user input?
Profile icon

In the code:

inF = open(input("Enter Filename: "),'r') import inF inF

Is there any way I can import the filename that the user inputs?

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
Profile icon

@Coder100 Sorry, let me rephrase that. How would I make it read the file that has been imported? eg:


where the at the end outputs the file