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.
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.
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.
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.
Next was a demo on microweb frameworks on Android. Vijay used bottle.py, a microweb framework, a demonstrated the following applications.
A simple hello world web app.
A date and time web app.
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.