r/learnpython • u/floridaturtles • Dec 23 '19
What are some creative small programs that you have coded using Python?
I am a beginner at coding with Python, so I am curious about learning what small programs or projects you all have created. I am hoping to develop my skills using Python, so I figured looking at actual code for various programs would greatly help.
Please include a short description of what the program does and the code itself in the comments below. Thank you!
348
Upvotes
63
u/Skippbo Dec 23 '19
When I put up a web server on my raspberry pi I once took a look at Apaches log file for incoming requests. It scared me with how much random traffic I was getting so i made this to add suspicious ips to my firewall.
It goes thru the log file for new ips and the database for old banned ips (30 days) and checks them against abuseIPDBs database and adds them to firewall if it's shady enough.
Main code is 200 lines with comments.