Tag archives for: python

Pelican is my blogging engine of choice these days. Given that Emacs is usually (though not always) my text editor of choice, it made sense to try and streamline the process of writing blog entries for Pelican with Emacs. What follows is my attempt to document such an endeavour, partly because I think it might be useful to the (undoubtedly tiny) cross section of people who use both Emacs and Pelican, but mostly so that I have something to refer back to when the need arises.

Note that this blog entry does not cover things like actually setting up your Pelican blog. It also doesn't cover my reasons for using Pelican in the first place; for that, feel free to peruse my other blog entry on the subject.

Read more →

In a previous post I wrote down some notes on the current state of the python packaging ecosystem. I felt that this was useful because most of the information that I found online was out of date or spread out in various places.

One area that still confuses me is the relative merits of requirements.txt versus setup.py files. Ironically, the best article I've read on the subject is aimed at ruby developers. I think python developers should read it - it's surprising (or maybe not so surprising) how similar the ecosystems are in this respect. I've even made a handy Rosetta stone, which is hopefully not completely inaccurate:

Read more →

Badges, on github and other code sharing sites, are a way to communicate small snippets of information concerning the status of your repository. They generally appear on your README file, so they are one of the first things you see when you load a repository page.

On my yawt page, for example, you can see several badges for things like my travis build status, and my GPA at code climate.

One thing that I couldn't find, however, was a pylint badge - a simple status that displayed your pylint score. This surprised me; it seemed like it should have been a common thing to want to do. Indeed, I'm still not 100% sure that I haven't simply overlooked something glaringly obvious.

Read more →

I use Emacs as a python IDE. The web already offers a significant number of resources on the subject but I've made a couple of specialized tweaks that I feel may be worth sharing. So here we go.

Why am I doing this? Well, the simple answer is that I like using Emacs. I do most of my writing in it. I use it as my task manager and TODO list. I have, in the past, used it as my email client. So it makes sense that I would use it as my python development environment. Your mileage may vary.

Read more →

I started YAWT a while ago, in python, because a) I wanted to learn a dynamically typed programming language and b) python seemed like a relatively easy, fun, popular, not insensible choice. To be fair, it is a fun language to use.

At the time, I gave very little thought actually packaging yawt - i.e. making it easy for someone to actually install and use. Mostly, I simply didn't think I'd ever have to do this - yawt was my baby, and I was the only one using it, so why bother?

My opinion about this has changed somewhat in recent months. I still don't think yawt is likely to be used by anyone but myself, but I find myself wanting to learn at least a little about how the python packaging system works - if only for myself. I mean, it should at least be easy for me to install it, right?

Read more →

I've been playing around with the Flask web framework for a while now. It's the basis for YAWT, the CMS/blogging system I'm currently developing (mostly as an exercise in familiarizing myself with Python)

With Flask, it's dead simple to get a very basic web application up and running:

from flask import Flask

app = Flask(__name__)

def hello():
    return "Hello World!"

def blah():
    return "Hello Blah!"

if __name__ == "__main__":

Put this in a python file called blah.py, mark it as executable, and run it. You should be able to access the web application on locahost:5000. It does not, admittedly, do anything even remotely interesting, but it's enough to get the basic idea.

Read more →

I started this blog 4 years ago, got a few entries in, and then promptly shut the whole thing down when it got overrun with spam. I have now resurrected it, using a new version of YAWT written in python which, for lack of a better name, I shall call YAWT 2.0.

At some point, I hope to write an article on the features of YAWT 2.0, but for the moment I'm just happy this thing is working again. Somewhat working, anyway; comments are still deactivated until I figure out how to do it properly.

Read more →