After defining this variable, simply typing booktxt will display your entire text file start to finish within your IDLE window.For example, typing booktxt = book.readlines() will define "booktxt" as your text file and allow it to be recalled within your program on a readable line by line basis. ![]() After opening your text file, you can tell Python what to do with it by defining it is a variable. Within the open() function, type a string containing the path of the location of your text file (in this case, it looks like open('C:/Users/mybringback/Desktop/pg16328.txt'), your location will of course look different).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |