Skip to content

Fun with curses (day one)

November 14, 2011

I’m getting ready to code my rogue-like. My medium is Linux(openSUSE 11.4 flavored), Python 3.1.3 and the curses library.

DISCLAIMER: This is not a tutorial, mistakes are bound to be made. This is a blow-by-blow of my attempt to make a “simple” game. If it helps you anyway, then awesome sauce.

First line:

#!/usr/bin/python3

On Linux, this allows me to save the file without an extension and run it as an executable. Without the “hashbang” (as it is called), Linux wouldn’t know what to use when it launches. I believe on most Linux distros, it defaults to bash (equivalent to Windows’ batch file code).

Next I type:

import curses, traceback

This allows me to use the content of the curses library. I’m also importing the traceback library so that I can output a more detailed error message when something goes wrong.

**feed readers for some reason do not indicate pagination. Most feed readers stop here. Come to the actual post to read the rest. Thanks! PPE*

Advertisements

Pages: 1 2 3 4

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: