December 25, 2007

Learning Python The Easy Way

Hello everyone! You may probably have heard about Python for the Nokia S60 platform. One of the most exciting features of this programming language is that it provides access to several unique smartphone functions, including the camera, calendar, audio as well as telephony amongst other things. This is partly why it has become so popular over time.

Some days ago I stumbled upon an excellent book related to Python for S60 devices. It's called "Mobile Python" and is written by J├╝rgen Scheible and Ville Tuulos.

Furthermore, for those of you interested, there's an amazing repository of Python code available online for free right over here. This is something that you must check out. There are over 100 examples to try out...from making a simple app that can record audio to making a message reader to taking pictures with your phone camera. The possibilities are endless!

One of the best ways of learning the basics of a language is by going through code examples step by step. That is where Python is so friendly and non-fussy. In case you falter, you'll eventually learn how to correct the mistake just by studying the code. Anyway, if you've come this far, just try this:
  • Grab a text editor (notepad will do just fine) and paste the code (try any of the examples above)
  • Rename the file to *.py and send it to your phone's memory card (e:\Python)
  • Install the Python for S60 application (PythonForS60_1_4_0_3rdEd.sis) on your phone
  • Install the script shell (PythonScriptShell_1_4_0_3rdEd.sis)
  • Next, run Python from your phone and click "Run Script" to execute the code that you've just sent
P.S If you don't already have Python installed, click here to get it for your S60 3rd Edition phone.

I hope you see how easy it is to make your own programs using Python. The code examples given above are enough to get one started. Anyway, happy python-ing!

5 comments:

GammaGoblin said...

The best part of python is that its a interpreted script language, meaning that you can actually write python on the very phone you intend to run it on :)

Taha M said...

Yup, very true. As a matter of fact, there's an Interactive Console that lets you do just that i.e. enter and execute Python commands on the Phone itself.

For those that haven't tried it out yet, run Python > Options > Interactive console

Next, try a basic command and see the output on the screen:

>>> print 'hello world'

(all lowercase; use the navigation key for 'enter')

Anonymous said...

If you're looking for a solution that will allow you to write Python scripts on your handset, I must recommend JBAK's DEdit (free!). I've recently installed it on my N73 and must say it's a remarkably usable text editor.

I used it in anger the other day to code a slideshow app from scratch and didn't encounter any problems. Who needs a PC anymore?

Anonymous said...

I recently found the link to the ebook "Mobile Python", the one that the author has mention in the post. if anyone is interested i can publish the url in this weblog.

best play tera said...

Thanks for sharing – There are couple of others which I think deserve a mention like 99 Designs etc. It will be great if you could also feature some UX sources in the list! Cheers

World Of Warcraft Gold is coming! No more waiting for days! Here you can always get 15 minutes Cheap WOW Gold Fast Delivery. Our fast and efficient delivery guy will make delivery right after the order confirmation process. Without delay!