Python Forum
Extending my text file word count ranker and calculator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending my text file word count ranker and calculator
#9
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.
Reply


Messages In This Thread
RE: Extending my text file word count ranker and calculator - by steve_shambles - Jan-25-2019, 08:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace a text/word in docx file using Python Devan 4 3,460 Oct-17-2023, 06:03 PM
Last Post: Devan
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,132 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Row Count and coloumn count Yegor123 4 1,336 Oct-18-2022, 03:52 AM
Last Post: Yegor123
  For Word, Count in List (Counts.Items()) new_coder_231013 6 2,621 Jul-21-2022, 02:51 PM
Last Post: new_coder_231013
  find some word in text list file and a bit change to them RolanRoll 3 1,549 Jun-27-2022, 01:36 AM
Last Post: RolanRoll
  python-docx regex: replace any word in docx text Tmagpy 4 2,247 Jun-18-2022, 09:12 AM
Last Post: Tmagpy
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,692 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 7,016 Feb-11-2022, 12:38 AM
Last Post: atomxkai
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,517 Aug-12-2021, 04:25 PM
Last Post: palladium
  all i want to do is count the lines in each file Skaperen 13 4,847 May-23-2021, 11:24 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020