What am I working on?

Well first things first I guess lets talk about what sort of computer(s) I will be using to learn python. I will be using two different computers for the most part, with the chance of their being a third in their at some point.

Both computers are running Linux, one running ubuntu and the other (my Xbox) running Xebian. One thing you’ll notice is that both distributions that I use are Debian based, this is simply because I’m a big fan of apt-get as a package management solution.

Neither of they computers are all that new or all that quick, but I think that they’ll get the job done.

To start off I’ve been reading a python tutorial, it’s pretty good and it giving me a good introduction. The first thing I did was file up the python interpreter by starting a terminal and typing:
$ python

Note: The $ represents the start of the command prompt, so I only typed the word ‘python’.

Here’s a quick tip about the python interpreter, if you want to quit try CTRL+Z or CTRL+d. I swear it took me forever to figure out how to exit the interpreter.

Here’s the first little bit of python that I typed into the interpreter:

>>> mark = 5
>>> if mark < 10: ... print 'less!' ...

And the result:


For those of you unfamiliar with the python interpreter when it is in “interactive mode” it will basically interpret whatever you type as you type it. So the first line I typed:

>>> mark = 5

Assigns the value 5 to the variable mark, not that difficult if you’ve ever programmed before. You’ll also notice the >>> that start the line those this is referred to as the primary prompt, and basically means that this current line is not reliant on any previous line.

You can see the difference in the next two lines:

>>> if mark < 10: ... print 'less!'

Which basically means if the variable mark is less then the value 10, print out 'less!' Since the if statement needs more lines of code before the if block is done, the next line starts with '...' which means that it's a continuation line.

You'll also notice that there is a tab before 'print less!', this is because in python white space has meaning. So instead of using a begin or an end tag, the white space delimits the code block. This is actually one of the features that I like the least about python, apparently one gets used to it, so I'll try not to complain about it.

After that there is is another line with continuation line starting with '...', that's basically the interpreter tying to figure out if the if block is going to continue. On that line I just hit enter, telling the interpreter that the block is done. Then the interpreter evaluated the if statement, and found out that mark was indeed less then 10 and so it printed out the results:


Well I’ll have to cut this post short, I was supposed to be somewhere 15 minutes ago, darn computers. What do you think they’ll say when I blame it on python?

12 thoughts on “What am I working on?”

  1. Hey thanks for the post about my site. It’s in it’s very early stages write now, but I hope to add much much more to it as I learn python.

    I’ll also add some person information soon, so I’ll be less anonymous on the site!

    I gave your top 10 list a read it’s got some good information and I’ll be sure to use it.

  2. Hi,

    Just wanted to let you know that I recently started using python. I think it’s going to be a great language to use as the swiss army knife. The REPL is invaluable for programming for exploration and it’s been helping me with my school projects (though it took a while to get handy with).

    If you haven’t already, go check out ipython (http://ipython.scipy.org/) .. makes the interactive shell more functional … really useful.

    Good luck on your new adventure .. I’ll be checking in every now and again to see how it’s going :-)


  3. Hey Steve,

    Thanks for the information, ipython looks pretty cool I’ll have to give it a try when I get more time. Hopefully that will be soon, I’m excited to try out a new language.

  4. Someone necessarily asssit to make critically articles I would state. This is the first time I frequented your website page and to this point? I surprised with the analysis you made to create this particular put up extraordinary. Wonderful job!

  5. Great win but questionable play calling and poor clock management at the end of the 1st half continue to frustrate me. Hopefully we quit spotting teams a 10 point lead before waking up.Now go embarass Auburn and make all those top Ga recruits rue the day they turned down thier home state school.

  6. achei q ia ser ruim mais n o filme é bom pode baixar……..só e ruim ter q ficar quebrando link para baixar,tentei 4 ate acharo certo….adm do site ajeita o link do putlocker por favore..obrigadooooooooooo site 10 Nota: 8

  7. Hi presently there just wanted to provide you with a simple heads up and let you know many of the pictures aren’t loading effectively. I’m unsure why but I believe its the linking issue. I’ve tried out it in two different browsers and each show a similar results.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>