Programming Examples
Python program to read the full content of specified txt file
Write a Python program which accept the file name from user and print the all content of file in console.
Solution
fname=input("Enter the file name : ")
fp=open(fname,"r")
print(fp.read())
fp.close()
Output
Enter the file name : myfile.txt
Infomax Computer Academy