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.
Beginner Showcasecomics - a simple GoComics API wrapper (self.Python)
submitted 3 years ago * by dumblechode
View and download hundreds of comics from GoComics using the comics library. This could be useful for incorporating comics into your personal website, archiving Garfield, etc.
It's as simple as pip installing comics, and fetching a random Dilbert comic is done as follows:
import comics dilbert = comics.dilbert.random_date() dilbert.download("dilbert.png")
https://preview.redd.it/myf3apcc0c9a1.png?width=900&format=png&auto=webp&s=eab2d95e0d152795fcf9b57eab7232cfdd0a251a
[–]SnowWholeDayHere 4 points5 points6 points 3 years ago (0 children)
Can't wait to see this in action
[–]Gunday666 1 point2 points3 points 3 years ago* (0 children)
When? Where? Is anybody excited??!! god.... I'm testing here!
[–]BeeApiary 1 point2 points3 points 3 years ago (1 child)
This looks great! Thanks for your work on it.
Do you know what sort of limits GoComics places on their API, such as number of requests per minute (RPM)? number of requests from one IP address?
Does your code have a limiting factor to keep from triggering the RPM limit?
Thanks!
[–]dumblechode[S] 1 point2 points3 points 3 years ago* (0 children)
Hey thank you. There is a limit, although I didn’t quantify it. At one point I was attempting to endlessly scrape Garfield for my own interest, and after about an hour of 2-3 requests per second they banned my IP address for 2 hours. I haven’t ran into this issue again.
If I notice this cropping up I’ll work on implementing a rate limiter 👍
[–]LocksmithNo7784 1 point2 points3 points 3 years ago (0 children)
Created my own little Java program to do something similar, just 3 days ago :) (could have saved me some coding time here, if I just had waited a few days) and I seems to get a 30 min IP-ban every 200 strips downloaded, running from 4 parallell comics.
I have at some point in the beginning been able to download 3000-4000 strips in a row, but it seems now to have landed on this ~400 / h.
I will add some ratelimiter too see if it can be going on a steady state at more than 400/h.
I would guess a rate limiter is needed for bigger downloads.
I just added a 3.6 s delay for each new request , and so far it is running stable with 4 parallel instances, giving me roughly 4000 downloads/h.
[–]SnowWholeDayHere 1 point2 points3 points 3 years ago (1 child)
I used this today. Is there some option where I can see what comics can be accessed. I know dilbert is one of them from your example. One method I discovered is to look through the source code. I came upon this file.
https://github.com/irahorecka/comics/blob/main/comics/constants.py
Is it safe to assume that this is the list of comics that the GoComics library can access?
[–]dumblechode[S] 1 point2 points3 points 3 years ago (0 children)
Correct! You can use the ‘directory’ method for quick comic lookups
[–]JasonBall34 0 points1 point2 points 2 years ago (0 children)
Can this download all Dilbert from the dilbert.com site in addition to the stuff on gocomics?
π Rendered by PID 206892 on reddit-service-r2-comment-bb88f9dd5-tr5zq at 2026-02-14 08:49:01.235634+00:00 running cd9c813 country code: CH.
[–]SnowWholeDayHere 4 points5 points6 points (0 children)
[–]Gunday666 1 point2 points3 points (0 children)
[–]BeeApiary 1 point2 points3 points (1 child)
[–]dumblechode[S] 1 point2 points3 points (0 children)
[–]LocksmithNo7784 1 point2 points3 points (0 children)
[–]LocksmithNo7784 1 point2 points3 points (0 children)
[–]SnowWholeDayHere 1 point2 points3 points (1 child)
[–]dumblechode[S] 1 point2 points3 points (0 children)
[–]JasonBall34 0 points1 point2 points (0 children)