Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I copied this straight from my textbook, but it doesn't work. Any help would be greatly appreciated.

Python
def main() :

		infile = open('progbday.txt', 'r')

		file_contents = infile.read()

		infile.close()

		print(file_contents)

main()


What I have tried:

I tried moving the indent around but idk. I'm completely clueless
Posted
Updated 10-Jun-17 21:16pm
v3
Comments
Patrice T 10-Jun-17 14:40pm    
Give exact error message.
Richard MacCutchan 10-Jun-17 15:23pm    
Works fine for me.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900