~vijaykumar

[ Home | Feed | Twitter | Vector Art | Ascii Art | Tutorials ]

Chennaipy June Meet Minutes

Thu, 17 May 2012

Chennaipy met again on the 30th of June, with talks on a wide range of topics. The meet was originally scheduled for 23rd June, but due to a full day power cut at the venue, the meet was rescheduled. The reschedule resulted in a low turn out.

We started the meet with a quick introduction to Python, as always. But this time Rengaraj gave the introduction. People gathered were brought up to speed on Python syntax and data types.

Python Classes

Rengaraj then started his talk on Python classes. He covered the syntax for creating a class. He showed how to create any empty class, instantiate it and attach attributes to the object. He then showed how the same thing can be done by using the init method.

Regex Module

The next talk was the Regex module by Reegan. Reegan gave short introduction to the re module. He then gave quick recap of the meta-characters. He then demonstrated the findall() function in the re module. The findall() function took a regex and a string, a returned a list of occurrences of the regex in the string. A dictionary file containing words with their part of speech and meaning. He use findall() to print verbs, adjectives and nouns from the dictionary file, by writing appropriate regex.

Named Tuple

The next talk was Named Tuples by Vijay. Vijay showed the purpose and advantages of tuples. He then listed their shortcomings:

  • Tuples with many members, do not indicate what value goes to what member, which affects the readability.

  • Accessing members in the tuple, is done using index, which also affects readability.

He then showed the namedtuple factory function that can be used to generate classes that behave to tuples, except that members can be accessed by name. The tuples also can be created by using keyword arguments. This gives us all the advantages of tuples, which affecting readability and maintainability of the code.

Demo: Python microweb frameworks on Android

Next was a demo on microweb frameworks on Android. Vijay used bottle.py, a microweb framework, a demonstrated the following applications.

  1. A simple hello world web app.

  2. A date and time web app.

  3. A form based web app, to add two numbers.

He then showed how this apps can be run on an Android mobile, using SL4A. The web app runs using the webserver provided by the microweb framework, and can be accessed through the phone’s browser. The best part was that the scripts run unmodified on the mobile phone.

Then to top it off, he showed a hangman game written as web app, which was developed on the PC, and runs unmodified on the mobile as well.

Permalink | Add Comment | Share: Twitter, Facebook, Buzz, ... | Tags: chennaipy, python

blog comments powered by Disqus

Powered by Python | Made with PyBlosxom | Valid XHTML 1.1 | Best Viewed With Any Browser | Icon Credits | CC-BY-SA