If you are not sure if the website you would like to visit is secure, you can verify it here. Enter the website address of the page and see parts of its content and the thumbnail images on this site. None (if any) dangerous scripts on the referenced page will be executed. Additionally, if the selected site contains subpages, you can verify it (review) in batches containing 5 pages.
favicon.ico: willpython.blogspot.com - Will's Python Notebook.

site address: willpython.blogspot.com

site title: Will's Python Notebook

Our opinion (on Monday 04 May 2026 23:46:34 UTC):

GREEN status (no comments) - no comments
After content analysis of this website we propose the following hashtags:



Meta tags:

Headings (most frequently used words):

the, and, will, python, notebook, sunday, march, 10, 2013, result, code, libraries, pil, images2gif, how, it, works, saturday, august, 21, 2010, about, me, tags, blog, archive, followers, top, in, an, animated, gif, multiple, event, loops, with, asyncore, asynchat, async_chat, threads,

Text of the page (most frequently used words):
the (61), and (29), #asyncore (21), #python (17), asynchat (15), map (14), code (12), class (11), that (11), for (10), async_chat (10), this (9), share (8), works (8), parameter (8), from (8), but (8), with (8), top (7), gif (7), threads (7), you (7), constructor (7), font (7), frames (7), event (6), loops (6), loop (6), self (6), draw (6), pil (6), images2gif (6), animated (5), new (5), support (5), multiple (5), can (5), module (5), method (5), image (5), 255 (5), threading (4), use (4), run (4), then (4), dispatcher (4), import (4), object (4), socket_map (4), used (4), dict (4), thread (4), safe (4), are (4), library (4), was (4), needed (4), frame (4), subprocess (4), text (4), line (4), width (4), txt (4), count (4), simple (3), unknown (3), parent (3), your (3), will (3), main (3), asyncchat26 (3), __init__ (3), conn (3), sys (3), version (3), none (3), named (3), which (3), provide (3), implement (3), like (3), own (3), they (3), easily (3), standard (3), not (3), pie (3), output (3), split (3), height (3), writegif (3), frame_delay (3), pie_pos (3), august (2), 2010 (2), march (2), 2013 (2), about (2), pinterest (2), facebook (2), blogthis (2), email (2), posted (2), simply (2), python2 (2), now (2), without (2), missing (2), newer (2), all (2), work (2), since (2), fix (2), need (2), def (2), small (2), shared (2), level (2), unfortunately (2), any (2), doesn (2), provides (2), features (2), its (2), optional (2), internal (2), each (2), also (2), have (2), other (2), data (2), using (2), read (2), why (2), into (2), how (2), when (2), two (2), render (2), modules (2), recently (2), lot (2), easy (2), drawing (2), number (2), per (2), enumerate (2), could (2), here (2), http (2), install (2), imaging (2), usr (2), imagedraw (2), imagefont (2), time (2), make_frame (2), fontsize (2), row (2), pieslice (2), 360 (2), stdout (2), showing (2), see (2), coding (2), notebook (2), theme, powered, blogger, followers, blog, archive, tags, view, complete, profile, subscribe, posts, atom, home, labels, whether, runs, may, separate, colliding, subclasses, subclassing, overriding, adding, implements, lines, setup, invokes, directly, includes, executes, delegates, original, otherwise, defer, 100, fine, else, passes, superclass, producer_fifo, fifo, ac_out_buffer, ac_in_buffer, version_info, helper, following, adds, creating, there, one, problem, only, affects, environments, earlier, than, causes, receive, default, value, tells, versions, intended, stock, rhel, stuck, dispatch, great, even, derived, classes, simplified, interface, somewhat, flexible, input, buffering, callback, found_terminator, set_terminator, gained, override, variable, letting, supply, lets, different, instance, making, perfectly, takes, safely, running, their, individual, still, must, ensure, solved, tools, lock, saw, wasn, way, scoped, store, sockets, select, poll, getting, deep, details, enough, note, private, source, safety, problems, both, operate, quickly, corrupt, enter, collide, spectacularly, causing, spurious, exceptions, corrupting, structures, execution, developing, protocol, client, asynchronous, worked, single, threaded, environment, needs, evolved, concurrent, found, specific, obstacle, came, clean, workaround, saturday, improved, example, should, hack, slice, rendering, done, first, full, circle, partial, filled, degrees, calculated, current, uses, once, interval, builds, calling, little, surprised, handle, newlines, multiplying, get, next, offset, collected, list, passed, outputs, special, header, extension, blocks, animate, looked, some, cleanup, didn, numpy, arrays, slightly, smaller, cleaned, pastebin, com, 1xdhnwfk, available, download, bit, xmmn5h, basic, canvas, processing, sudo, yum, fedora, rpm, libraries, bin, imagesequence, 650, 300, truetype, fonts, liberation, liberationmono, regular, ttf, rgba, getsize, 204, int, 128, return, range, popen, pipe, append, sleep, topmovie, duration, dither, 770kb, seconds, pretty, misbehaving, chrome, tab, chewing, entire, cpu, core, added, green, chart, thingy, give, visual, indication, position, within, animation, times, would, confusing, result, thought, most, practical, thing, seemed, fun, challenge, minimal, noticed, gifs, google, feed, mainly, cats, sunday, things, learned, while,


Text of the page (random words):
will s python notebook will s python notebook things i ve learned while coding in python sunday march 10 2013 top in an animated gif i noticed a lot of animated gifs showing up in my google feed recently mainly it was cats i thought why not render top output as an animated gif it s not the most practical thing but it seemed like a fun challenge to see if i could do this with minimal python coding the result a 770kb gif showing about 12 seconds of top output you can see pretty easily that i have a misbehaving chrome tab chewing up an entire cpu core i added the green pie chart thingy to give a visual indication of position within the animation since it loops 10 times and would be confusing the code usr bin python from pil import image imagedraw imagefont imagesequence from images2gif import writegif import os subprocess sys time frames 12 frame_delay 0 75 width height 650 300 pie_pos width 50 10 width 10 50 font imagefont truetype usr share fonts liberation liberationmono regular ttf 12 def make_frame txt count font font image image new rgba width height 255 255 255 draw imagedraw draw image fontsize font getsize 1 for row line in enumerate txt split n draw text 5 fontsize row line 0 0 0 font font draw pieslice pie_pos 0 360 255 255 204 draw pieslice pie_pos 0 int 360 0 frames 1 count 0 128 0 return image frames for count in range frames txt subprocess popen top c n 1 b split stdout subprocess pipe stdout read frames append make_frame txt count time sleep frame_delay writegif topmovie gif frames duration frame_delay loops 10 dither 0 the libraries pil and images2gif i run fedora 18 which provides the pil library as an rpm named python imaging so you can install that easily sudo yum install python imaging the pil modules provide the basic drawing and canvas processing features and the images2gif py module works on top of pil to implement the animated gif standard the images2gif py library is available for download here http bit ly xmmn5h the images2gif py code looked like it could use some cleanup and i didn t need its support for numpy arrays so a slightly smaller cleaned up version is also here http pastebin com 1xdhnwfk how it works the code uses subprocess to run top once per frame interval and builds a new frame by calling the draw text method for each line in the output i was a little surprised that pil s text method doesn t handle newlines but it was easy to implement using split and enumerate on the text and multiplying the line number by the font height to get the next offset all the frames are collected into a list and passed to the writegif method from images2gif which outputs the special header and per frame extension blocks needed to animate the gif the pie slice rendering is done by first drawing a full circle and then a partial pie with the filled in degrees calculated from the current frame number this code can be improved a lot but as an example to work from it s small and should be easy to hack on posted by unknown at 5 25 pm email this blogthis share to x share to facebook share to pinterest saturday august 21 2010 multiple event loops with asyncore and asynchat async_chat and threads i recently needed to support multiple concurrent event loops with asyncore and found a version specific obstacle in asynchat and came up with a simple and clean workaround i was developing a protocol client library that needed to be asynchronous my code used asyncore and asynchat and worked in a single threaded environment but then my needs evolved and it now needed to support execution from multiple threads unfortunately the asyncore and asynchat modules in the python standard library are not thread safe when two threads enter the main event loop in asyncore loop they collide spectacularly causing spurious io exceptions and corrupting asyncore s internal data structures i read the asyncore py code and saw why it wasn t thread safe the way the main event loop in asyncore loop works is that a module scoped dict named socket_map is used to store the sockets that are then used with select or poll without getting into the deep details of how asyncore works it s enough to note that asyncore s use of it s own private socket_map dict is the source of the thread safety problems when two threads both operate on this shared object they quickly render it corrupt in python 2 4 the asyncore dispatcher class constructor gained a new optional map parameter it is used to override the internal socket_map variable letting you supply your own dict object this lets you provide a different dict object to each instance of asyncore dispatcher making it perfectly thread safe the module level asyncore loop method also takes an optional map parameter so you can have multiple threads safely running in their own individual event loops you still must ensure your threads are safe for any other data they share but that is easily solved using threading lock and other tools from the standard threading module this works great even for derived classes of asyncore dispatcher like asynchat async_chat a class that provides a simplified interface and somewhat flexible input buffering features with its set_terminator method and found_terminator callback but there is one small problem that only affects python environments earlier than 2 6 the asynchat async_chat class constructor doesn t implement the map parameter this causes the asyncore dispatch class to receive a default value of map none which tells it to use the shared module level socket_map object newer versions of async_chat in python 2 6 provide the map parameter but unfortunately any code intended to run on stock rhel 5 is stuck with python 2 4 the following code adds support for the map parameter to the asyncore async_chat class by creating a new class named asyncchat26 import asyncore asynchat sys class asyncchat26 asynchat async_chat helper to fix for python2 4 asynchat missing a map parameter def __init__ self conn none map none if python version 2 6 if sys version_info 0 2 2 6 python 2 4 and 2 5 need to do this self ac_in_buffer self ac_out_buffer self producer_fifo asynchat fifo the fix passes map to the superclass constructor asyncore dispatcher __init__ self conn map else otherwise we defer 100 to the parent class since it works fine asynchat async_chat __init__ self conn map it works by simple subclassing it works by overriding the asynchat async_chat constructor adding the missing map parameter and re implements 4 lines of setup code from the newer async_chat constructor the code then invokes the parent class constructor directly but includes the map parameter if the code executes in python 2 6 it simply delegates all work up to the original constructor for code that subclasses asynchat async_chat you can simply use asyncchat26 as the new parent class and your class will support map whether it runs on python 2 4 or python2 6 multiple threads in python 2 4 may now run separate asyncore loop main event loops without colliding posted by unknown at 4 20 pm email this blogthis share to x share to facebook share to pinterest labels asyncore asynchat threading home subscribe to posts atom about me unknown view my complete profile tags asyncore asynchat threading blog archive 2013 1 march 1 top in an animated gif 2010 1 august 1 followers simple theme powered by blogger
Thumbnail images (randomly selected): * Images may be subject to copyright.GREEN status (no comments)

Verified site has: 9 subpage(s). Do you want to verify them? Verify pages:

1-5 6-9


The site also has 1 references to other resources (not html/xhtml )

 blogger.googleusercontent.com/img/b/R2___.gif  Verify


Top 50 hastags from of all verified websites.

Supplementary Information (add-on for SEO geeks)*- See more on header.verify-www.com

Header

HTTP/1.1 200 OK
Content-Type text/html; charset=UTF-8
Expires Mon, 04 May 2026 23:46:34 GMT
Date Mon, 04 May 2026 23:46:34 GMT
Cache-Control private, max-age=0
Last-Modified Mon, 16 Sep 2024 00:48:32 GMT
ETag W/ 5d0b8ef4283c5a2c66358b70c311a59d4dc2c6544285a7e1a09b4de8c7b315e2
Content-Encoding gzip
X-Content-Type-Options nosniff
X-XSS-Protection 1; mode=block
Content-Length 13579
Server GSE
Connection close

Meta Tags

title="Will's Python Notebook"
content="width=1100" name="viewport"
content="text/html; charset=UTF-8" http-equiv="Content-Type"
content="blogger" name="generator"
content="htt???/willpython.blogspot.com/" property="og:url"
content="Will's Python Notebook" property="og:title"
content="Things I've learned while coding in python." property="og:description"
name="google-adsense-platform-account" content="ca-host-pub-1556223355139109"
name="google-adsense-platform-domain" content="blogspot.com"
content="Will's Python Notebook" itemprop="name"
content="htt????/blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGIXpmJ9D-keUUCtxkEuGLidrZIbxO-luUaM4WFNkG9szUdLNaNFLhB2AEbdMGJzXsoGMl7Q5oWBbP7CZObkhCaH2CXmYiU2RZQZlObNozXp41MISToPwbbeFsn9M5Ao4AdUcODRdJaKWo/s1600/topmovie.gif" itemprop="image_url"
content="8046960742061485447" itemprop="blogId"
content="1875869853545406450" itemprop="postId"
content="htt????/www.blogger.com/profile/07787752537023885656" itemprop="url"
content="htt???/willpython.blogspot.com/2013/03/top-in-animated-gif.html" itemprop="url"
content="8046960742061485447" itemprop="blogId"
content="7320654085799208514" itemprop="postId"
content="htt????/www.blogger.com/profile/07787752537023885656" itemprop="url"
content="htt???/willpython.blogspot.com/2010/08/multiple-event-loops-with-asyncore-and.html" itemprop="url"

Load Info

page size13579
load time (s)0.217664
redirect count0
speed download62576
server IP 142.251.39.193
* all occurrences of the string "http://" have been changed to "htt???/"