How can I open a file based on user input?
Profile icon
ANDREWVOSS

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
ANDREWVOSS

@Coder100 So if I structure it as

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

How would I read the file?