Posts where I used the Python programming language and thought that was interesting.
tags → python
Jul 9, 2017
Miguel Grenbergs’ Flask Mega-Tutorial and book helped me understand using Python’s Flask microframework. Well, somewhat. My understanding would improve if I used it more. Haven’t taken advantage of the opportunity yet. Anyways - of course I decided to back his Kickstarter for updating the Flask Mega-Tutorial.
Jul 4, 2014
I have been spending much of my coding time in Python recently. This site is built in Pelican. Many lines of Python have been written for work. I have even been poking at Google App Engine in what spare time is available. The only disappointment is that all of these have been in Python 2. I would prefer to be using Python 3. There is a little free time today, so I will set up a nice Python 3 workspace.
Jun 12, 2009
I had to focus my efforts last time on restoring the original functionality of my Python Blogger script. That’s out of the way. I can now start looking at enhancements. The first annoyance - of many - is the fact that Blogger connection settings are hard-coded into the script. Do you want to post to a different blog? That’s going to require editing the source.
Jun 9, 2009 (Updated Jun 12, 2009)
I wrote a post a while back about using Python to write Blogspot posts from the command line. It took me about two weeks to completely forget about it. Still, it’s one of the few posts on this blog that gets regular visits, and the code … well, the code is not great. It was a fair effort, but it didn’t even accomplish the things I had initially set out to do. Account information is hard-coded into the code, for example. I also blundered along haphazardly with parsing metadata information myself despite the fact that Python Markdown has an extension which is perfectly capable of handling metadata. Well, let’s look at that code again.
Jun 14, 2007 (Updated Jul 11, 2009)
This is Part 3 of an ongoing series about writing interactive fiction games in Python. By the end of Part 2 we had created a text-based user interface and explored one way of storing multiple scenes. This part will finally bring the needed glue for the player to move between all of the scenes in the story. In other words, we’ll have a game!
Apr 20, 2007 (Updated Jul 11, 2009)
This is the second part of an ongoing series about using Python to create interactive fiction. I hope to show you one fun use of Python while teaching you more about the basics of this language. We started by defining how our game was going to work and creating a set of scenes for play. Next we wrote the code to handle a single round of the game. Today we are going to tie all of our scenes together to make a complete, playable game of interactive fiction. We are going to approach it from an experimental view, playing with different approaches until we find one that makes us happy. Well, one that makes me happy.
Apr 19, 2007 (Updated Jul 11, 2009)
I think the next step is to write the code for a single round of the game. We’ll limit ourselves to Scene 1 to stay focussed.
Jul 11, 2004 (Updated Jul 11, 2004)
There are several different approaches to programming, but the one that is easiest for me to grasp is imperative programming. The imperative approach allows you to tell the computer exactly what you want it to do and how you want it done. The best analogy I can think of is a cooking recipe. You have a list of ingredients and a specific set of instructions to follow. Veer from the recipe and you may not be happy with the results. Veer too far from the recipe and your house could burn down.