168 views, 0 RAMs, and 0 comments
This is technically a different error message, but is what was causing the issue.
string = "The value is one hundred (100)." # Raises an error print("This is 100% of a sentence:\n%s" % string) # Traceback (most recent call last): # File "<stdin>", line 1, in <module> # TypeError: %o format: an integer is required, not str # This does not raise an error print("This is 100%% of a sentence:\n%s" % string) # This is 100% of a sentence: # The value is one hundred (100).
TL;DR: Escape the percent symbol (%) with two percent symbols when using string formatting in Python.
Sir, I can do you a nice SEO.
Post a New Comment
Do you like having a good time?
Register an Account
Read Quality Articles
Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.
Argue with People on the Internet
Use your account to explain why people are wrong on the Internet forum.
Vandalize the Wiki
Or don't. I'm not your dad.
Ask and/or Answer Questions
If someone asks a terrible question, post a LMGTFY link.
Make Some Money
Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.
Answers— Read More
Find more related content below!
- [BASH, cURL] Yellow Pages Scraper: Fully Functional Script with Source Code
- [cURL, BASH] How to Crawl and Scrape DuckDuckGo Search Results
- The Basics to Web Scraping with cURL and XPath
- Extracting Emails from HTML with Google Sheets: Get Contact Information in Bulk for Guest Posts, (lmao) 404 Re...
- [Infographic] The Beginner's SQLite Cheat Sheet
- Analyzing the Web: Downloading the Majestic Million, Setting up SQLite, Crawling the Web, and Generating Repor...
- Downloading Bulk Images: ThisPersonDoesNotExist with Python and urllib2
- Spit in the Face of God: Five Tasks You Didn’t Know Could be Done with Google Sheets
- An introduction to scraping with Python and BeautifulSoup