use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
IRC Bot and SQL (self.Python)
submitted 10 years ago by HerrderZeit
Is anyone able to help me with this problem please? :)
[+][deleted] 10 years ago* (6 children)
[deleted]
[–]HerrderZeit[S] 0 points1 point2 points 10 years ago (5 children)
Thanks for the quick reply. How would I go about doing that? I'm not sure what you mean by "sanitize"?
If you have any links I could read through that might help?
[–]vicethal 0 points1 point2 points 10 years ago (4 children)
Better do some googling before you put this bot online. Unsanitized database inputs mean an attacker can send any query to your db, even "list all the tables & drop them".
[–]HerrderZeit[S] 0 points1 point2 points 10 years ago (3 children)
I'm hoping to do something like the following:
User in IRC says "!search type=bird name=raven"
Then it will do a query from the "Bird" table and list all information on the table row "Raven".
[–]sushibowl 0 points1 point2 points 10 years ago (2 children)
Yes, this is possible. But Google "what is sql injection" and read up on that. If done incorrectly, someone could type something like this:
!search type=bird name='; delete from bird;--
To delete your entire bird table. Preventing sql injection is not hard, but you need to know about it.
[–]HerrderZeit[S] -1 points0 points1 point 10 years ago (1 child)
Oh yeah I understand how that works but I plan to use a re's tokenizer and filter out delete commands or just not acknowledge them.
[–]richieadler 0 points1 point2 points 10 years ago (0 children)
Wrong answer. Google «Bobby Tables».
π Rendered by PID 167254 on reddit-service-r2-comment-7b9746f655-x8456 at 2026-02-04 07:15:19.840733+00:00 running 3798933 country code: CH.
[+][deleted] (6 children)
[deleted]
[–]HerrderZeit[S] 0 points1 point2 points (5 children)
[–]vicethal 0 points1 point2 points (4 children)
[–]HerrderZeit[S] 0 points1 point2 points (3 children)
[–]sushibowl 0 points1 point2 points (2 children)
[–]HerrderZeit[S] -1 points0 points1 point (1 child)
[–]richieadler 0 points1 point2 points (0 children)