Showing posts with label Texas. Show all posts
Showing posts with label Texas. Show all posts

Thursday, February 10, 2011

A PyCon Tutorial Preview in Dallas THIS Saturday

This year, DFW Pythoneers member Paul Kippes has prepared a tutorial for the US PyCon titled:

"Creating GUI Applications in Python using Qt"
http://us.pycon.org/2011/schedule/sessions/207/

In order to practice giving his tutorial before PyCon, Paul has volunteered to teach it here locally during the upcoming 2nd Saturday meeting, Sat Feb 12, from 2:30pm till 5:30pm.

This is an excellent opportunity for anyone interested in building cross-platform GUI apps using Python, as it will provide a introduction to using one of the major GUI frameworks: QT, which is the basis for KDE, as well as many cross platform applications running under Linux, Mac OS, Windows, Symbian, Embedded Linux, Windows Mobile, and Maemo.

Registration is free, but seating is limited, please reserve your spot by emailing Brad Allen and confirm that you will attend. If more than 15 people register, we may need to move it to a different venue, so please let Brad know as soon as possible whether you plan to attend.

Please arrive by 2pm so that the tutorial can start at 2:30pm sharp.

As long as we stay below 15 people, the meeting will be held at the usual DFW Pythoneers meeting location,

company|dallas
1701 North Collins Boulevard
Second Floor (Near Suite 2000)
Richardson, TX 75080
Phone: 972-231-0052
Website: http://www.companydallas.com

Wednesday, July 22, 2009

DFW Pythoneers 4th Saturday Meeting

This Saturday is the usual 4th Saturday meeting of the DFW Pythoneers. We're meeting at the coworking facility Company|Dallas in Richardson at noon. Bring your lunch, they have free drinks. You can find directions at their website.

We'll start with informal discussion about what's happening in Python, along with some "what does this code do" Python examples I found in the unit-testing code for the cPython interpreter. Would you recognize a backtracking generator? How about a lazy list iterator? For a taste, check out test_generators.py

There will also be simple examples for those new to Python.

While we start gathering at noon to talk over lunch, the formal presentation won't start until 2pm. I'll be giving a presentation from PyCon 2009 about Python Namespaces, Code Objects and How They Work Together Under The Hood.

And if there is interest, I'd like to continue sprinting on reimplementing the M.U.L.E. game using the Pyglet OpenGL framework. We can split into teams tackling two pieces reusable in other games:
  1. An Avahi/Bonjour-based network component for detecting the presence of all active games of a certain kind (e.g. M.U.L.E.) on the LAN, determining which are currently open for new players (i.e. in the game start phase) and returning this information for presenting in some kind of GUI. A user can then select which game to join. Because of the nature of the network, this should be implemented in an asynchronous fashion.

  2. A Pyglet-based component for animating a character walking across the screen in all eight directions. It should contain a step generator that controls the rate of walking, and listen to events from the keyboard (or joystick or network) telling it in which direction to walk. It must be possible for multiple instances to exist so that players can concurrently walk their characters around the board. Other components should be able to subscribe to walk events to handle actions based on where the character is walking including slowing or aborting the walk.
We can discuss perhaps doing this in the style of a Code Dojo:

Schedule
12:00 lunch
02:00 "Python Namespaces and Code Objects"

I hope to see you there!

Friday, February 20, 2009

DFW Pythoneers, 2nd Sat: Topics We Covered

The 2nd Saturday of February meeting of the DFW Pythoneers went well, with 5 people showing up even though it was Valentine's Day. We covered a grab bag of topics I'd researched ahead of time. It was part of a new plan of mine to structure our meetings a bit, by each month covering (1) a module in the standard library, (2) a programming concept, (3) a source code walkthrough and (4) a few "how would you do this?" type of questions. Feedback on this approach is welcome.


For the module in the standard library, we briefly covered the new print() function in Python 2.6:
from __future__ import print_function  # Python 2.6                                        
print(objects..., sep='', end='\n', file=sys.stdout)
and then the new .format() method on strings, as an alternative to the C style sprintf("%s %d", a, b) approach. The format() approach is more powerful than the % operator but takes some getting used to.

Feedback from some attendees is that it is too complicated, so we also covered the much simpler but less powerful Template module in the standard library.
  >>> from string import Template
>>> s = Template("$who likes $what")
>>> s.substitute(who='tim', what='cake')
tim likes cake
>>> s.substitute(who='tim') # error
...
>>> s.safe_substitute(who='tim')
tim likes $what

For the programming concept, we studied sequence slicing and subscripting.

While most of us have a good grasp on simple subscripting and from:to slicing, there are some deeper aspects here, a few of which can be seen in:
  a[4:5:5]    # extended slicing, with a stride
a[3, 4, 5] # a slice list
a[2:4, 5:7] # list of slices
a['a':'c'] # applying slicing to non-integers and non-ordinal content
We also looked at the deceptively simple shallow copy operation:
a[:]
and how it differs between mutable (list) and immutable (tuple) types.

And then we looked at the little-known builtin type 'Ellipsis' and how it can be used in your own programs.
  a[...]
a[..., 0] -> mapobj[:,:,:,0] # PyNumeric interpretation
In order to experiment with the various subscript/slicing syntaxes, we defined our own __getitem__, __setitem__ and __delitem__ methods to print out what was received:
  >>> class alpha:
... def __getitem__(self, key):
... print "Key is %s" % repr(key)
... return None
...
>>> a = alpha()
>>> a[3, 4. 5]
...

Next we took a little trip over to look at the issues and concerns involved in the simple idea of sorting items in a collection:

We studied the difference between the .sort() method and the sorted() builtin function, and the three arguments (cmpfn, key, reverse) you can pass to either one.

This also brought us into the operator module which has several useful functions for extracting values on which to sort from items, such as:
  key=operator.itemgetter(1)
key=operator.attrgetter('eggs')
and we talked about (but didn't dig into) the well-known design pattern of "decorate-sort-undecorate".
For the questions of "how would you do this?" we discussed:

  • How can you test for whether a variable is defined?

  • How do you tell if a method is bound or unbound?

  • How do you 'unbind' a method?

  • How do you set an attribute whose name is not a legal Python name?

  • How can you conditionally define methods in a class?

  • How do you change the data underneath a mutable sequence without breaking any existing bindings to the sequence itself? Hint: Look in site.py.


For the source code walkthrough we examined the implementation of the string Template class in lib/python/string.py. The interesting part was its use of a metaclass to post-process the extraction strings defined in the class into compiled regular expression objects.
And by special request by a member, we looked into how Python at startup arranges its module import path (sys.path) to find zip/eggs and parses 'path configuration files' (.pth) that alter that path. We also covered the privileged status of 'site' directories over other directories on the path and did a very quick walkthrough of the source in lib/python/site.py as well as the lib/python/site-packages/site.py installed by setuptools.
That filled our 3-hour session and we wrapped up with chatter about the rapidly approaching PyCon and the early registration deadline.

Thursday, July 31, 2008

DFW Pythoneers, 4th Sat July, Topics Covered

For the 4th Saturday meeting of July, we had a good group show up for the beginners session at 1pm. The target audience were existing programmers new to Python. We had 10 people besides myself there and then at the regular 2pm start time, some people left and some came in, raising it to 12 people. I presented on the underlying concepts of Python that make it easy to learn yet powerful.

We covered introspection at the Python prompt, using dir(), type(), id() and help() to examine your environment as well as the useful "python -v" and "python -i" arguments. Then we got into names and values and how they are organized into namespaces everywhere you turn in Python. We got into the differences between 'is' and '==', mutability, shared vs non-shared structures and whether names are by-ref or by-value. I went over the simple values then the compound values like mappings, sequences and sets.

Around 2pm when the main meeting began we went over how a Python source file is structured, how it gets converted into multiple codeblocks, which are executed immediately and which are executed later. This was a tricky concept for some with lots of discussion. We covered how the Python module system is derived from that for Modula-3, the various kinds of import statements, the true meaning of the global statement (i.e. not really global overall), how modules are aggregated into a navigable top-level set of in-memory namespaces and some of the metadata you can find in them, like __name__ and __file__.

We took a look at the most common modules all programmers should know, such as __builtins__, sys, os, os.path, string and re (derived from Perl), and a bit on the types module. We reviewed the various control structures that Python gives us and also the ones it lacks, such as switch/case and do/while. We looked at the exception model of Python, how it differs from other languages in its continuability and restartability and the correct usage of exceptions in Python for error conditions, not normal control flows.

We touched lightly on the underlying behavior protocols of Python, for object, number, sequence, mapping, iterator and buffer, how Python uses protocols instead of class derivation for grouping behavior. We then got into Python's idea of OOP, the topmost object class, initializers/destructors and the binding of self and what it means when you have an unbound method. We sidestepped metaclasses and the type hierarchy for now but got in a mention of ducks (type peeking), turtles (all the way down) and monkeys (patching).

And because it is such a key concept, we went over 'callables', how different things can be called transparently and the powerful argument passing mechanism Python uses re positional, keyword and default. We touched a bit on what it means to be iterable and moved on to the more concrete ideas of being subscriptable, from/upto, negative ordinals and subscript ranges or slicing. The third slice argument for skipping, forward and backward, was a popular topic.

It was almost 5pm by then and we were running out of time, so we briefly covered predicates; if a == b, if a is b, if a/not a, and the has_key (in) and hasattr tests. We wrapped up with a couple of short code walkthroughs just to see the concepts in use.

----
This kind of presentation was an experiment to see if there is a demand in our group for a return to the basics of the Python code instead of covering the web framework flavor of the week. Based on this first response, it seemed popular so we'll do it some more at future meetings. I'm going to try to break it apart into relatively standalone topic chapters and, when I do, make those materials available online.

I'll be at WorldCon during our 2nd Sat meeting of August but we'll do this again for the 4th Sat meeting.

Wednesday, April 16, 2008

DFW Pythoneers, 2nd Sat: Topics We Covered

Here in Dallas we had our 2nd Saturday (April 12th) meeting at the Nerdbooks.com store. We covered a diverse set of topics, as follows:
Much of the time was on the Google AppEngine, the darling of the blogosphere at the moment. A couple of us managed to get accounts so we went through the demonstration site provided with the Google SDK, and create a trivial application at http://dfwpython.appspot.com. The AppEngine infrastructure allows one to grant development privileges to other people, so we opened this application up to experimentation by other user group members.

For more information about our group, check out our user group wiki.

-Jeff

Wednesday, September 19, 2007

Texas Unconference Over, Next DFW Pythoneers Meeting This Saturday

=== Texas Python Unconference ===

For those who didn't make it to Houston last weekend, the first Texas Python Unconference went very well. On Saturday we had at peak 44 attendees and on Sunday 12 attendees. You can see a group photo at:

http://pycamp.python.org/Texas

It was a single track of presentations with roughly 16 talks, a few of which made their slides available at:

http://pycamp.python.org/Texas/Schedule

There was lots of interesting conversation over lunches and dinners as well as in the breaks. My thanks to the University of Houston for hosting us with a great presentation facility (and generously providing snacks/drinks), Robin Friedrich for event coordination/MC, Josten Ma for getting us into the University and coordinating and the good folks at Enthought for springing for pizza during lunch (if I've overlooked a contribution, my sincere apologies).

I would encourage other regions of Python users to hold their own unconferences, which require much less work that a formal conference. You are welcome to make use of the wiki above - just create a folder off of the root for your region.


=== 4th Saturday Meeting of the DFW Pythoneers ===

This Saturday in Dallas we have our 4th Saturday meeting at Nerdbooks.com, at the usual 2 PM until 5 PM. If there is interest, I can repeat two of my Houston talks; a demonstration of how to program the TuxDroid to talk, wave and dance about, and a code walkthru of a simple program that uses the VPython (visual python) framework to animate simple geometric shapes (a pyramid slowly colliding with a checkerboard while a ball spaceship launches to get away) using OpenGL. Martin Thomas is going to bring his TuxDroid as well so we'll see how to coordinate them over their wireless network using Python.

If you want an early peek or cannot make it this Saturday, you can find the source to the two demos in our club version control system, at:

https://www.dfwpython.org/repo/Projects/tuxtoys/tuxdemo.py
https://www.dfwpython.org/repo/Projects/VPython/vdemo.py

We'll leave the OpenMoko cellphone GUI and pyMIDI piano trainer for our next meeting. ;-)

I'd also like to suggest folks install the Gobby application on their laptops. Gobby is a peer-to-peer networked, shared text editor and chat program. It is written completely in Python and may be good for collaborative notetaking at future events. A number of us would like to check it out for usability among a group.

http://gobby.0x539.de/trac/

It does run under Windows as well as Linux and Mac, although you must install some dependencies outlined in the install notes. It has also been packaged for various operating systems, so for some it will be a simple click install. Be sure to get the latest version as you cannot mix the old and new versions on the network.

Hope to see you this Saturday!

-Jeff

Wednesday, June 20, 2007

Dallas-Ft. Worth Pythoneers Meeting THIS Saturday

This Saturday we'll be holding our 4th Saturday meeting of the DFW Pythoneers, at the usual location of Nerdbooks.com bookstore in Richardson. For directions, visit the Nerdbooks.com website. We start at 2pm and run until 5pm, and then go out for a group dinner.

At this meeting one of our local members, Jeremy Dunck, will be giving us a preview of a 60-minute advanced Django tutorial he is helping to give at OSCON next month. The advanced material will cover the unicode branch, signals and either stateful views or gis branch.

Since many of our members are not experienced with Django, Jeremy will present a 45-minute introduction to Django first, which will cover URLConf, views, models and perhaps middleware.

---
By the way, I've been contacted by a developer at the Dallas Travelocity office, who is looking for Python developers with experience in Django or Genshi. If you're interested, let me know and I can put you in touch.
---

And just to give a heads-up for July, Patrick R. Michaud has agreed to give our group a presentation on the status of support for Python in the virtual machine, Parrot, underlying Perl 6 and many other languages. If you're not familiar with what Parrot is, check out:

http://www.parrotcode.org

Patrick will present to us on the 2nd Saturday of July, the 14th.

See you there!

Jeff Rush
DFW Pythoneers Organizer

Thursday, June 7, 2007

About This Past DFW Pythoneers 4th Sat Meeting

Although it was Memorial Day weekend, the DFW Pythoneers held their Saturday meeting at the Nerdbooks store as usual. For those who don't know, we meet at the store on the 2nd and 4th Saturday of every month, from 2pm until 5pm. We have a projector and draw around 7-14 attendees currently. At this meeting we had 8 people as I recall.

This meeting was a rapid fire sequence of mini-talks, by various people. As a result of the work on the Forrester survey, I had some simple, clearly documented source examples, provided by Martin Thomas (local), Mario Ruggier (not local) and myself. They can be found in our club subversion repository.

One of them is a mashup by Martin of placing temperature readings collected from one site using REST, onto a DFW Google map.

Another is HTML page generation using Twisted Nevow/STAN, along with an RSS feed parser module to embed a list of the N most recent news stories.

And one is a simple but powerful presentation and form validation using the Gizmo(QP) framework, which does the validation both in the server and in the browser using JavaScript. No big deal, until you realize the JavaScript in the browser is generated from the Python source, and the whole source fits on a couple of screens.

I had also had recent opportunity to toss together a simple RSS client (15-lines or so) that pulled down a collection of photos from an Apple site, for the non-Mac user and did a walk-thru of the source.

John Zurawski had at the previous meeting presented on his entry into the 48-hour PyGame challenge but since most of the attendees at this meeting had missed this, he walked through his source for us again.

And since I had had to compute some statistics for the Forrester survey of Python mail traffic, I walked thru my first use of the really cool BeautifulSoup module, for screenscaping the Mailman interface to locate and download the message archives.

And then we wrapped up with a quick examination of Raymond Hettinger's NamedTuples recipe from the Python Cookbook site. It had recently floated by on Planet Python and I just thought its implementation was neat.

We may have covered other topics that I've forgotten, but that was the gist of it.

Our 2nd Saturday meeting of June is this weekend, and we're looking for presentation ideas. There has been a request for a repeat of Martin's TuxDroid (programmable with Python) demo by those who missed the first one, and a test of having two TuxDroids within RF range. Brad has offered to cover the power of the Python logging module, and I can skim how you can write a filesystem in Python using the FUSE (filesystem in userspace) module. More topics are welcome, as these tend to be short.

Jeff Rush
DFW Pythoneers