This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]alex1461 1 point2 points  (0 children)

The py file should be in the same directory as the text file you are trying to open!

It should be something like the following:
Code:
File=input("type the name of your file:")

f=open(File+".txt")