I enjoy doing silly things with code - having an idea that makes me chuckle and then figuring out how to make it happen. These are often fun diversions, an exercise in pushing my limits and Python's - but sometimes they turn into proper projects which I release, other people use, and I then need to maintain. As a result, a lot of my projects harbour a dark secret or two, and I've used a lot of techniques to hide them away and protect my users from the troubles they can bring. I'm going to talk about these techniques ...
Read full post
I've released a new version of Mara, my network service framework written in Python. It aims to make it easy to build TCP/IP services, such as echo servers, flash policy servers, chatrooms, talkers and MUDs.
It's event-based; that is to say you write event listener functions which you bind to events that your service raises - like Connect
, Receive
or Disconnect
.
Mara is on pypi, so you can pip install mara
, then start writing your service. An echo server in Mara looks like this:
from mara import Service
service = Service()
@service.listen(mara.events.Receive)
def receive(event ...
Read full post