This line: subbed = line[-3:]
will give you the last 3 chars of line
which can never be ‘ok’ which is 2 chars.
More Related Contents:
- Python: AttributeError: ‘str’ object has no attribute ‘readlines’
- How to replace multiple substrings of a string?
- How can I create a text input box with Pygame?
- How can I split a text into sentences?
- BeautifulSoup Grab Visible Webpage Text
- How can I remove non-ASCII characters but leave periods and spaces?
- How to send email to multiple recipients using python smtplib?
- How might I remove duplicate lines from a file?
- How to print bold text in Python?
- Inserting Line at Specified Position of a Text File
- Only extracting text from this element, not its children
- Editing workbooks with rich text in openpyxl
- Scatter plot with different text at each data point
- The smtplib.server.sendmail function in python raises UnicodeEncodeError: ‘ascii’ codec can’t encode character
- How to use python-docx to replace text in a Word document and save
- How to display text in pygame? [duplicate]
- Remove very last character in file
- How to increase/reduce the fontsize of x and y tick labels
- Box around text in matplotlib
- gmail login failure using python and imaplib
- How to send utf-8 e-mail?
- Add advanced features to a tkinter Text widget
- Styling part of label in legend in matplotlib
- How to extract information between two unique words in a large text file
- Specify a sender when sending mail with Python (smtplib)
- Who originally invented this type of syntax: -*- coding: utf-8 -*- [duplicate]
- How to send an email using python after Google’s policy update on not allowing just username and password?
- “[Errno 101] Network is unreachable” when trying to send email using Django
- Send table as an email body (not attachment ) in Python
- Download attachments from Gmail using Gmail API