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
InvisibleOne

As far as I know, you can't. I'm interested to know why you want to do this? What are you trying to make?

Profile icon
ANDREWVOSS

@InvisibleOne I was mostly just wondering, but I also wanted to make a program that could be used to seamlessly launch other programs from it.

Profile icon
InvisibleOne

Hmm, sounds interesting @ANDREWVOSS

Profile icon
ANDREWVOSS

@InvisibleOne I finished it

Profile icon
InvisibleOne
Profile icon
ANDREWVOSS

@InvisibleOne I think I'll post it in Share

Profile icon
ANDREWVOSS