Skip to content

{ Category Archives } Python

All things Python.

Largest Palindromic Number In Python

I found the absolute best way to learn the Python programming language, while at the same time, increasing deductive logic capacity and learning mathematics. The way is through Project Euler. Of course, you don’t have to use the Python language to complete the problems. You can use any language you like, or [...]

Prime Numbers In Python

The following program returns True if a number is prime or False otherwise. I am proud of this code, as it implements dead code. Upon the first positive condition in the if statement nested in the while loop, the program terminates, ignoring any further code following. As far as I can tell, [...]

Recursion In Python

I took my Perl script that I wrote some time ago, and rewrote it in Python. The exercise of the initial Perl script, was to get a better handle on the language using recursion, and to inventory my Ogg Vorbis collection of music. The same reasons were used for this Python version. [...]

29 And Holding

from datetime import date
 
birth_day = date(1977, 6, 9)
right_now = date.today()
 
if (right_now.month >= birth_day.month) & (right_now.day >= birth_day.day):
age = right_now.year - birth_day.year
else:
age = right_now.year - birth_day.year - 1
 
if age >= 30:
age = 29

Poll: First Programming Language?

My coworker asked me this question, and began asking a few others in a couple IRC channels. So, I thought I’d extend it to my blog, and the planets that I syndicate. I added as many choices as I could hoping to see a wide array of votes. I added a few [...]

Some Spam Karma Automation in Python

Being a Wordpress blogger, unfortunately, I have to wade through tons and tons of comment spam. As of current, I have caught 18,119 comment spams since the inception of this blog in September 2005. Thats more than 1,000 spams per month! That’s some serious spam.
Problem is, though, that some of it is [...]

Python and the Horrendous Tab Character

This thread was on reddit about a month or so ago, but I didn’t stumble on it until just recently. Basically, the thread talks about the dreaded tab character, and it’s effect on Python code using different editors. I have pasted the items I find most interesting.
It’s amazing the philosophy changes that one [...]

“We’re Going In A New Direction”

Looking back at the archives of this blog, it’s overall theme and vibrancy has changed throughout the months, and honestly, I don’t like where it’s landed. So, this blog is taking a new turn and revisiting it’s roots.
The initial reason this blog was put up, back in September 2005, was to provide an archive [...]

Python Fibonacci Sequence

So, in case you were wondering, Pthree stands for Perl, Python and PHP. I know, I know. I haven’t posted hardly anything at all. So I make a feeble attempt at starting now.
Everything that I have been doing at work is supposed to be written in Python, but instead, I have been [...]

Gmail-notify as an Example of the Power of Open Source Software

The example I am about to expense is why Open Source Software (OSS) is so powerful.
A friend of mine was reading my blog, and cheking out my Firefox extension list (that I still need to update badly). He noticed that I use the gmail notifier extension for Firefox rather than the gmail-notify package for [...]

Sudoku Mania

My wife and I were in Barnes and Noble last night. Of course, the first place I go is the magazine rack to pick up the latest Linux Format issue, then over to the prgramming section to get a new computer book. I was completely torn between a number of different computer books, [...]

Spellbound, The Workforce and Firefox Market Share

Being a serious Firefox junkie, I was testing out a couple new extensions when a fellow coworker came by my desk and asked me what I was doing.  He then asked what extensions I find useful, at which point I began showing off Spellbound.  Immediately, he jumped out of his seat and couldn’t believe his [...]

Python File Handling: Part I

Because learning a new language takes a little bit of time, I haven’t had much to blog about here. I would like to blog more often, but I feel that I need to get a hang of the language before I can venture too far into blogging about it. I woudn’t have much [...]

Number Arrays in Python

Being new to Python and completely discovering the language has been quite the experience. I find it realy cool that it is whitespace dependant, and that indenting matters. This helps reduce alot of the “chatter” that is common in C/C++, Java, Perl, etc.
This week, I decided, among other things, to write a game [...]

One Solid Python IDE

A house contractor utilizes the best tools of his trade. As does a plumber, carpenter, mechanic and technician. So should developers.
It is easy as a developer to get caught into using simple tools to get the job done. For example, when editing a web page, a simple text editor gets [...]