Jan-25-2019, 08:25 AM
Nice try Drone, I installed nltk and tried to run
your script with alice.txt in same dir got:
Choose from this list of books:
1. Tolstoy
2. Alice
3. Chesterton
What is your pick? 1.? 2.? or 3.? >> Searched in:2
Traceback (most recent call last):
File "C:/Python365/alice.py", line 35, in <module>
main()
File "C:/Python365/alice.py", line 26, in main
selection = choose_book()
File "C:/Python365/alice.py", line 12, in choose_book
print(f"You picked: {selection[:-4]}!") # for testing
TypeError: 'NoneType' object is not subscriptable.
I don't have a clue how to help, sorry.
your script with alice.txt in same dir got:
Choose from this list of books:
1. Tolstoy
2. Alice
3. Chesterton
What is your pick? 1.? 2.? or 3.? >> Searched in:2
Traceback (most recent call last):
File "C:/Python365/alice.py", line 35, in <module>
main()
File "C:/Python365/alice.py", line 26, in main
selection = choose_book()
File "C:/Python365/alice.py", line 12, in choose_book
print(f"You picked: {selection[:-4]}!") # for testing
TypeError: 'NoneType' object is not subscriptable.
I don't have a clue how to help, sorry.