Archive | Python

The object-oriented scripting language

Notes from the Python Special Interest Group, 18-Nov-2010

Four members attended the November meeting of the Python Special Interest Group, held a week early due to the Thanksgiving holiday (anticipate a similar schedule for December). The Amoskeag Business Incubator was kind enough to allow us to use their smaller meeting room, which worked out perfectly for the smaller crowd.

It was an open Q&A evening, and boy, did we have Qs and As! Topics covered included:

  • Getting scanners working on Ubuntu 10.10
  • sharing printers in Ubuntu
  • Why DSL isn’t always at its rated speed
  • what a CO and a DSLAM is
  • Win7 Starter Edition blue-screening on an Asus Aspire One
  • the New Microsoft/Verizon KinONEm KinTWOm
  • the disaster that was the Microsoft-Danger hiptop acquisition
  • Microsoft’s announcement of Java as a “first class citizen” of their Azure cloud
  • Microsoft’s “Embrace, Enhance, Extend, Extinguish” history
  • Maybe they’ll call it IronJava? And, hey, where did IronPython go?
  • Oracle and Java and licensing and FUD
  • Oracle and MySQL and licensing and FUD
  • A public library looking for a Linux-based solution to reserving PC use
  • A great suggestion to consider Gnome Nanny
  • generating PDF Forms out of a LAMP app using pdftk
  • OpenOffice.org and LibreOffice
  • Generating PDF fill-in forums out of OpenOffice.org, courtesy of Solveig Haugland
  • the difference between “business class” and “consumer grade” machines
  • Dell and HP, Linux support, HPLIP Open Source project
  • printing to PDF in Ubuntu only worked when App Armor was removed
  • the ease of hooking up a projector to Fedora 14 with the new video subsystem and Noveau drivers
  • installing NetworkManager on Debian Lenny (there’s python in there!)
  • a quick tour of NetworkManager on Fedora 14
  • a demo of using Elementree to parse and modify an XML file used to manage installs of Atlassian Jira
  • using BeautifulSoup to parse an HTML file and generate an INI file
  • the Venus software for generating an RSS aggregator page
  • hacking WSDLs for SOAP using suds

Those were the Qs. You needed to be there for the As. And the awesome gingerbread cookies and frosted cake.

Thanks to Janet for the desserts, to Bill for organizing the meeting, to the Amoskeag Business Incubator for the facilities, and to all who attended and participated. Look for the December meeting announcement with the date tentatively planned for the 16th.

PySIG Notes, 23-Sept-2010, Bill Freeman and Django

Seven folks attended the September meeting of the Python Special Interest Group of the Greater New Hampshire Linux User Group held as usual on the 4th Thursday of the month at the Amoskeag Business Incubator in Manchester. Bill Sconce, PySIG’s organizer, supplied milk and Janet supplied (excellent!) chocolate chip cookies.

Bill Freeman was the presenter for the night, and spoke about Django. Django is a web framework written in Python. It supports the WSGI web server gateway interface specification which allows a standard way of connecting to web servers and provides facilities to “stack” additional WSGI-compliant applications to act as filters, caches, security modules, etc. between the web server and your application. Bill walked through the flow of data through the application’s architecture from http request, through parsing, views and the template language, processing in the ORM and out as the http response. There are hooks galore where you can add your own code, modifying the flow of data and responses. Django is a world-class web framework, with facilities to plug in additional “engines” — mini-applications — and add your own template tags, customize the automated generate of the data schema, and of course, write your own application logic. It’s Open Source, it’s Python, and the code is there for you to mess with. Django’s most popular add-on provdes an administrative function that provides developers (and, optionally, their customers) with simple add/edit/delete forms. Django seems to be a platform well worth considering if you’re interested in web apps in Python. Bill’s slides are available on the GNHLUG wiki.

Thanks to Bill Freeman for a great presentation, to Bill Sconce for organizing the meeting, to Janet for the awesome cookies, and to the Amoskeag Business Incubator for providing the fine facilities.

Notes from Python SIG, 27 May 2010

The May meeting of the New Hampshire Python Special Interest Group was planned as an informal chat, and there was no dearth of topics! We met as usual (the fourth Thursday of the month) at the Amoskeag Business Incubator (http://www.abi-nh.com) in Manchester, from 7 – 9 PM. Seven people attended the meeting.

We had a demonstration of a prototype of a video bulletin board system to be used for the community TV channel in Pepperell, MA. It was using a Python script to drive displays including slides in OpenOffice.org Impress and videos played in VLC. Interesting libraries in use include shlex for parsing command lines and a graphics library whose name I missed to generate the “crawler” at the bottom of the screen.

We discussed the licensing issues with video and audo codecs and the solution that’s provided by Fluendo.

We looked at the new photography management application Shotwell included in the most recent Fedora and Ubuntu distributions. Shotwell is written in the new Vala language that “aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C” and Bill noted another derivative language, Genie, which has a style far more similar to Python. (You wondered what all this had to do with Python, didn’t you?)

We looked for some solutions for accessing the output of Java classes from within a Python application., citing pages like this and discussing the pros and cons of the solutions available. We’re looking forward to a future meeting where we get a report on how it comes up.

As always, a good time was had by all. Thanks to Janet for yummy chocolate chip cookes and frosted brownies. Thanks to the Amoskeag Business Incubator for the use of the facilities, to Bill for organizing and moderating the meeting. and thanks to all for attending participating.

PySIG notes, 25-Feb-2010: CSS

Six people braved miserably wet weather to attend the February meeting of the Python Special Interest Group, held as usual on the fourth Thursday of the month at the Amoskeag Business Incubator.

We had a brief set of introductions and announcements of upcoming meetings. We hope to host a discussion of PyCon 2010 presentations by PySIG members next month; details to be worked out, stay tuned.

I’ve seen this presentation seven times and I think this was the best. Along with the Introduction to CSS, I added a “sneak peek” preview of HTML5 and CSS3 and discussed the support (finally!) for CSS 2.1 in Internet Explorer 8 and how that meant the leading browsers all had support for some intriguing features as outlined in the SitePoint book, “Everything You Know About CSS is Wrong!” There was lots of give and take with the audience, and a few side trips off-script to cover an issue someone wanted to know more about, and a war story or two. Ben Scott was heckled in abstentia.

Slides can be found at http://www.tedroche.com/Present/2010/css/css.html.

Thanks to Bill for arranging and promoting the meeting, to the Amoskeag Business Incubator for the fine facilities, to Laura and the Hopkinton High girls basketball team fundraiser for the M&M cookies, and to all who attended and participated.

Notes from Seacoast LUG, Caroline Meeks and Sugar on a Stick

The Seacoast Linux User Group met last night, as they always do on the second Monday of the month, in Morse Hall Room 301 on the UNH Durham campus, at 7 PM. Kudos to Robert Anderson who’s been running the group… well, forever. Sixteen people attended last night’s very interesting meeting, which featured Caroline Meeks speaking on “Sugar on a Stick.”

Caroline’s been involved in Open Source since 1999 and is very interested in education. Her business, Solution Grove (http://www.solutiongrove.com) specializes in Open Source learning and knowledge management. She’s currently studying at Harvard Graduate School of Education and plans to complete her Masters in Education this year. She spoke (and demoed) enthusiastically about the activities available on Sugar and the remarkable effects they had on kids, leading to very positive educational outcomes.

Sugar on a Stick, a project from Sugar Labs, is an effort that puts the Sugar desktop (started on the One Laptop Per Child machines) onto a USB stick so an educational computer is available to a child any time they can access a computer. (SugarLabs is a spinoff open source project, with it’s own Sugar Labs Oversight Board (yes, SLOBS) and an all-volunteer force.) Caroline presented what Sugar on a Stick can do now, how it’s working in and out of schools, discussed the technical hurdles they are running into and made an appeal for help in testing/debugging/building, especially on Ubuntu’s project, the Sugar Remix.

Sugar on a Stick addresses the Achille’s Heel of the One Laptop Per Child program: despite a number of successful pilot programs, most deployments of OLPC haven’t resulted in each child having their own computer that they could keep with them, take home safely and use fulltime. When children have to share computers, or only get an hour at the lab, they are missing out. Sugar on a Stick lets the kids take their USB sticks with them and use them in whatever computer is handy. They can run their projects on Mom or Dad’s computer without harming that machine (or vice versa!) and can play whenever a machine is available.

Some games and educational programs don’t work at improving outcomes. One attendee cited an example of a well-known reader game. A study revealed that scores went _down_ after six months of using the reading program. The attendee referred to it as the “Drill and Kill” syndrome.

There’s lots of work that needs to be done on the project. The current version, based on Fedora’s Live stack, was developed in an era of much smaller capacity USB sticks and made compromises that aren’t needed any more. The compressed filesystem is suspected of being a problem with the corrupted stick phenomenon, which occurs too often to consider the project “ready for prime time.” Caroline said that, with a classroom of kids working Sugar on a Stick, there would always be one or two corrupted sticks. That’s too much data loss, too much frustration and disappointment, and too much disruption to be suitable for a classroom environment.

SugarLabs need mentors (those of us in LUGs) to finish making the software work. There’s not a lot of money in it right now, although they are looking at all possible grant sources. There’s a lot of enthusiastic high school students who need help pointing them in the right direction. College students have an opportunity to use a “Do Something” grant to provide compensation for working on this project. The call to action is for mentors and those familiar with the internals of Linux, especially Ubuntu’s live media functionality, to coach, mentor, supervise and help out in getting the next version of Sugar on a Stick, the Ubuntu Sugar Remix.

Prezi was the presentation software http://prezi.com/ Caroline was using. It was pretty neat. Her presentation can be found at: http://prezi.com/kuuhqwmkxxtm/ Caroline’s presentation and demonstration were quite impressive, and her obvious enthusiasm for the project lead to an energentic question-and-answer session at the end.

Thanks to Caroline for the presentation, to Robert and UNH for hosting and all for attending and participating!

Notes from Python Special Interest Group, 20-Nov-2009

Eight people attended the Python Special Interest Group, held a week early to avoid the Thanksgiving holiday. Anticipate a reschedule December meeting as well.

Last night’s meeting was a vigorous and far-reaching discussion of MySQL, Oracle, the future of MySQL, Maria DB, OpenOffice.org automation using Python, OpenOffice.org automation using Visual FoxPro, Twisted, IE6, Zope, Plone, Django, MS SQL Server, pyodbc, SQLAlchemy, Cascading Style Sheets, IE6, FireFox and FireBug, User Agents, IE6, how not to insulate a bungalow roof, the (Python!) cssparse module (http://cthedot.de/cssutils/), Fortune’s selection of Steve Jobs as “CEO  of the Decade”, Lenovo netbooks and Ubuntu, the Millennium, why calendar years are one-based and not zero-based, distributed version control systems, master-slave and master-master replication using MySQL and Postgres, svn and git, and more! Whew! You should have been there!

Thanks to Bill for organizing the meeting, to all for attending and participating, and to the Amoskeag Business Incubator for providing the great facilities!

Stay tuned for an announcement of the December meeting, and hope everyone has a good Thanksgiving!

Adding Fail2Ban to the web site

I swapped out web servers two weekends ago, when the old machine started showing some unacceptable behavior. Part of that swap involved switching from a CentOS-based Linux distribution to an Ubuntu-based distribution. There were some great learning moments involved in that. I also wanted to swap out a few programs that hadn’t worked as well as I had hoped.

One of the new packages I’m trying out is Fail2Ban, an Python-based application to review the logs and temporarily bans IP addresses based on the patterns of abuse. Similar applications like DenyHosts are well-rated, but DenyHosts specializes in ssh, which hadn’t been too much of a problem for me, and didn’t have a straight-forward configuration for ftp, which unfortunately I must offer. I had used a similar Perl-based application before, but it hadn’t supported a couple of a my applications, and appeared to introduce some instability in the system. Fail2Ban came with configurations for Apache 2 and vsftpd. In their wiki, there was a HOWTO for banning PHP-based file upload attacks, something which had begun to fill the logs with nonsense.

So, 48 hours in and things seem to be running well. The log files clearly show some applications being blocked, other applications seems to be running well, and performance and responsiveness of the site seems to be okay.

Notes from Python Special Interest Group, 27-August-2009

Twelve folks attended the August meeting of the Python Special Interest Group, one of the most active chapters of the Greater New Hampshire Linux User Group. The meeting was held on the regular night, the fourth Thursday of the month at the Amoskeag Business Incubator in Manchester, gathering at 6:30 with the formal meeting starting at 7 PM.

I gave the usual pitch about the GNHLUG, checking the calendars for upcoming meetings, joining the announcement mailing lists for low-traffic meeting announcments, or the GNHLUG and PySIG discussion list for slightly-higher traffic but high-quality technical discussions, and mentioned some of the upcoming meetings. I also reminded members that user group discounts are available from many of the book publishers, and that if they are interested in reviewing a recently released book, I can request one through the user group program.

Software Freedom Day is coming up September 19th, and Arc will be running an event in Manchester. Keep an eye on the mailing list for further details.

Mark talked about his monthly Tech Talk presentations in at the Lawrence Library in Pepperell, MA (next meeting, September 30th), and his Tech Talk newsletter. Mark is doing a great job getting the word out there and spreading the message about Free/Open Source to non-technical folks. He’s also tried to get a hearing about Open Source in his local schools, but without much luck. Mark also pointed out the new Full Circle magazine Issue 27, which starts a tutorial series on Python.

Arc Riley gave a quick demo of Crunchy, a python-based local web server for serving Python tutorials. Looks neat.

Arc talked about the Python Software Foundation and the Google Summer of Code and also here. The project Arc mentored helped to develop the 3to2 program for rolling back code written for Python 3 to run in Python 2.x. While the code is still in an alpha state, it successfully performs a lot of the conversion needed, and will continue as a framework for the final product. Arc managed the GSOC for the PSF. The Python Software Foundation had the second largest number of sponsored GSOC projects (Apache was #1) and most were completed successfully. Thanks to Arc for a lot of hard work this summer!

Kent S. Johnson talked about itertools. Itertools provides a simple way to represent and manipulate large sequences of numbers without the necessity to consume large memory and CPU resources with creating the entire sequence before iterating over the sequences. Starting with some simple examples of arrays and lists, sequences and generators, Kent built up examples (with some contributions from Bill Freeman) into a more complex problem that illustrated why itertools is so handy. Well done!

Bruce Labitt is almost single-handedly responsible for keeping the pysig mailing list going this summer. Bruce talked about the work he’s doing with intensive calculations and huge arrays. Bruce is building some complex simulations of radio waveforms and calculating various aspects of the radio waves for regulatory compliance. He’s using Python and NumPy and other libraries to generate test data and simulations, and interfacing common PCs with some supercomputing facilities for the heavy number-crunching. Very interesting talk.

Thanks to Bill Sconce for organizing the meeting, to Mark, Arc and Bruce for presenting, to Janet for the awesome cookies, to the Amoskeag  Business Incubator for the great facilities, and to all for attending and participating.

Notes from PySIG, 28-May-2009

It was a dark and stormy night. Nonetheless, six members made it to the May meeting of the Python Special Interest Group, held as usual on the fourth Thursday of the month at the Amoskeag Business Incubator in Manchester.

We had an Open Mike Night format, a round-table discussion where everyone shared what they were working on.

I plugged upcoming meetings, available as always at http://gnhlug.org — MonadLUG in particular, is to be praised for posting 4 months worth of meetings in advance.

Mark has a client who’s weaning off a proprietary OS and looking for a replacement document management system / word processing system, and is considering LyX, which is a  front end to LaTeX and has numerous utility scripts written in Python. Mark asked for suggestions for additional resources and the two Bills were able to come up with some ideas.

Arc talked about some wireless technologies he’s researching (neat stuff!). Arc also reported the Gaming SIG is coming along nicely: 5 people at the first meeting, 10 at the second. Details at gnhlug.org . Hoping to schedule a FPS (First Person Shooter) night soon. Coming up next Friday June 5th, the SIG will take a look at the awesome audio utility, Audacity, as it relates to gaming, and then engage in the Battle for Wesnoth.  Gaming SIG meets at the Brady Sullivan building in the DynInc offices on the fifth floor – see http://wiki.gnhlug.org/twiki2/bin/view/Www/GamingSIG.

Shawn O’Shea completed a course in Network Design and Planning at UMass Lowell (and got an ‘A’, congrats!) and showed us his lab work, written in Python! He very bravely showed us his code and we talked about some of his algorithms and looked at a couple of the modules he used, including optparse, netaddr and cmd.

Bill Freeman reported he’d been working in Plone and Python 2.4 and missed some of the features available in later versions. He created some code to address the worst of the deficiencies, and hopes to be able to release it freely soon. Stay tuned.

Thanks to Bill for organizing the meeting, to the Amoskeag Business Incubator for the fine facilities, to Arc for bailing us out with an extension cord, to Janet for the awesome (!) cookies, and to all for attending and participating!

Notes from Python Special Interest Group, 17-December-2008

Six folks attended the December meeting of the Python Special Interest Group, held on the irregular third Wednesday in December to allow for the festivities next week. (We normally meet the fourth Thursday, same place, same time.)

There wasn’t a formal agenda, and discussion was first the ice storms of last week and everyone’s power status.

I talked with Bill about setting up my new Sansa player with Rockbox and using gPodder in Fedora10 to sync music. The gPodder Podcast client can sync with using the standard file-based method or by using the Media Transfer Protocol popular in many players. To run with gPodder, I needed to install libMTP and PyMTP (there’s a Python connection!) I also discovered while importing RSS feeds that there’s a bug in Fedora 10’s version of Mark Pilgrim’s awesome feedparser, fairly easy to patch, documented here. It’s an arguable bug; it may be that feedparser throws an error instead of behaving more gracefully when hander RSS that might not be fully valid, in this case apparently a bad Unicode character. Perhaps not fully following Postel’s Law, paraphrased “be conservative in what you do and liberal in what you accept.” Is ignoring malformed Unicode too liberal? A philosophical question, perhaps. I noted that the RSS feed that fails in gPodder and from the Python command line actually passes the http://feedvalidator.org tests. Hmm.

Arc had sent a link, “If Languages were Religions,” which included the suggestion, “Python would be Humanism: It’s simple, unrestrictive, and all you need to follow it is common sense. Many of the followers claim to feel relieved from all the burden imposed by other languages, and that they have rediscovered the joy of programming. There are some who say that it is a form of pseudo-code. ” Read the whole post; there are some good ones!

Bill Freeman had an idea he’d like to float for a project to avoid name contention issues, using a naming scheme similar to Java’s com.sun…. namespace for individual projects. Kent dug around in the comp.lang.python archives for some previous threads on the subject to review what had been said on the issue before.

Kent wanted to talk about Python 3.0! Shawn had sent a link to the list for Python porting resources, but wasn’t able to make the meeting. We discussed some of the issues with porting 2.x Python code to Python 3.0 and tested out the 2to3 program. Arc and Matt arrived and joined in the conversation. We first converted the canonical “hello world” program and worked up to Bill’s telephone list program, Arc suggested jinja, and an unpublished project that Kent had been working on involving recognizing human languages, each of which had gradually more and more complex issues. The 2to3 program won’t always make working code, but it does a fine first pass in making all of the well-known changes in converting a 2.x program to 3.0. In running the programs through 2to3 and examining the results, the group had a good discussion about some of the syntax and structural changes in 3.0

Thanks to Bill Sconce for organizing the meeting and bringing the milk, to Janet for the wonderful airplane cookies, to the Amoskeag Business Incubator for providing us with the great facilities and to all for attending and participating.

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.