![]() |
Python help w/ .txt file - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Python help w/ .txt file (/thread-16486.html) |
Python help w/ .txt file - chicks4 - Mar-02-2019
def main(): infile = open('numbers.txt', 'r') file_contents = infile.read() infile.close() print(file_contents) main()I hope I used the tags correctly!!! I am new! RE: Python help w/ .txt file - ichabod801 - Mar-02-2019 You need to run the program from the same folder that numbers.txt is in. RE: Python help w/ .txt file - chicks4 - Mar-02-2019 I see, I had it saved on the desktop instead of the same folder. That worked. Seriously, thank you for all your help, ichabod801! :) |