Archive for the 'Python' Category

New Software Projects Site

Friday, August 26th, 2005

For those of you seeking the goods, they can now be found at my new projects site. Recursively, one of the available projects is the project site itself: brockman*. Just install it, add your own projects, and away you go.
brockman is written in Python (of course) using the CherryPy web application framework and [...]

Lazy or Impatient?

Wednesday, May 25th, 2005

Man, I really enjoy programming in Python. I mean, it is really fun. Like digital Play-Doh.
I took an idea from, um, idea to socket-based networked client application with IP based security in one afternoon. Then, I continued with the idea and made a socket-based networked controller application that reads its configuration data [...]

CherryAuth

Wednesday, March 23rd, 2005

So I released CherryAuth today. It is my first contribution to an open source project. Makes me feel kind of warm and fuzzy.
I hope it works (it does for me).
The idea is that it should be a system of enablers and providers of authentication for CherryPy web objects. Currently the [...]

new game update

Friday, June 25th, 2004

Ok, I have uploaded a new version of my game code. It’s still not a game at all really, but I have done some new stuff. The main improvements are the ability to move in 8 directions on the map and to wrap around the east-west edges of the map. Also, the [...]

The planets have aligned…

Monday, June 21st, 2004

Holy cow. I happened to check out CivFanatics today and found some exciting info: According to Civilization IV lead programmer Soren Johnson, Civ IV is going to be scriptable with Python!! I am certain that I find this much more exciting than you, my readership, but since this is my blog, I had [...]

Civilization in Python?

Wednesday, June 16th, 2004

The other day, I stumbled upon OpenCiv - a Civilization I clone written in Python. I found it while searching for information on tile based strategy games in Python to learn more about making my own game (see a couple entries ago). The code for OpenCiv is getting on 10 years old now, [...]

Writing a Game

Monday, June 14th, 2004

Enough already. I’m through playing games!
Ok, not really, but instead of playing one right now I am making my own. I don’t have too many specifics right now. It is going to be a tile-based strategy game a-la Civilization (but not as refined/good/fun/insertPositiveAdjectiveHere). It is going to be what I make [...]

42

Friday, June 11th, 2004

This question came up on the python tutor list:
What is the most convincing way to mimick this in Python?

#include <stdio .h>

#define SIX 1 + 5
#define NINE 8 + 1

int main(void) {
printf(”What do you get if you multiply six by nine: %d\n”, SIX *
NINE);
return 0;
}

I dutifully came up with this answer…

class define:
… [...]

python simplicity

Thursday, May 6th, 2004

Ok, needed to return only the numerical portion from a string like ‘h00009492a802.ne.client2.attbi.com’. Pretty simple to do in Python:

def onlyNum(s):
num = [n for n in s if n.isdigit()]
return ”.join(num)

Voila. And the result?

>>> s = ‘h00009492a802.ne.client2.attbi.com’
>>> onlyNum(s)
‘000094928022′

The idea was to check the amount of numerical [...]

a useless program

Wednesday, April 7th, 2004

After my wife commented that I write “useful programs”, that reminded me of this program that I finished up yesterday. Basically, you type in a word and it looks it up on merriam-webster.com and plays the pronunciation of it over your speakers. It only works on Windows right now, as that is where [...]