Sydney Python Meetup July 21: Python, Perl, and Cold Beverages

2005-07-18 Thread Alan Green
Date:   Thursday July 21
Time:   6:00pm-8:30pm, with drinks and food during and after.
Topics: Graham Dumpleton on The Vampire mod_python extension
 Paul Fenwick So you want to start a business?

Place:  James Squires Brewhouse
 2 The Promenade,
 King St Wharf
 Sydney
Fee:$0.00

The Sydney Python meetup group is on this Thursday. The meeting time has 
been brought forward half an hour, and the formal part of the evening 
will commence promptly at 6:30pm.

The James Squires Brewhouse managed to book the Python Meetup Group and 
the Perl Mongers in adjoining rooms for the same night. Everybody has 
promised to be nice and we'll be combining with them to hear from one of 
their Melbourne gurus.

As always, everybody is welcome.


Graham Dumpleton, author of Vampire, will be speaking first (6:30-7:30). 
He describes his presentation thusly:

Although I'll talk a bit about the motivations behind writing Vampire 
and why this extra layer on top of mod_python is useful, what I want to 
talk about more is what I have learnt from writing Vampire. From that I 
would like to go on to describe a new and better way of doing this same 
thing for mod_python that Vampire attempted to do. This new approach 
moves even further away from the monolithic framework approach towards 
small building blocks of functionality that can be slotted together to 
build up a web application how you want it and not how some framework 
dictates you should do it.

More information on Vampire can be found at 
http://www.dscpl.com.au/projects/vampire/

Paul Fenwick of the Melbourne Perl Mongers will also be speaking 
(7:30-8:30). His talk, So you want to start a business, will be 
presented at the SAGE-AU conference later this year, and an abstract can 
be found online at 
http://www.sage-au.org.au/conf/sage-au2005/speakers.html#fenwickabs
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations.html


Re: Make a .WAV file come out of the left speaker in Windows

2005-07-18 Thread Alan Green
Alan  Green wrote:
 I am writing a Python script that uses the win32all winsound package to
 play a .wav file. I [need] the sound come out of the left hand speaker, but
 not the right hand speaker.

I eventually got out ctypes and used it to access the Windows
multi-media libraries. ctypes is completely amazing, especially with
the code generator to turn the windows C header files into Python
functions and constants.

Just yesterday I discovered PyMedia, and will have to have a play with
that, too.

a

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Replacing last comma in 'C1, C2, C3' with 'and' so that it reads'C1, C2 and C3'

2005-07-12 Thread Alan Green
Ric Da Force wrote:
 Hi guys,

 Thank you all for your input!  It was good to see so much convergence in the
 approach!

Just for divergence, you can also do this with regular expressions:

 import re
 re.sub((.*),(.*), r\1 and\2, C1, C2, C3)
'C1, C2 and C3'

Alan.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Searching through a list of tuples

2005-07-12 Thread Alan Green
Peter Otten wrote:
 Repton wrote:

  I often find myself storing data in a list of tuples, and I want to ask
  questions like what is the index of the first tuple whose 3rd element
  is x, or give me the first tuple whose 2nd element is y.

  items = [(1, a, 10), (2, b, 20), (3, c, 30)]
  class Key(object):
 ... def __init__(self, key):
 ... self.key = key
 ... def __eq__(self, other):
 ... return self.key(other)
 ...
  items.index(Key(lambda x: x[2] == 20))
 1

Neat solution.

I'd add an extra kind of Key, since finding tuples where a given
position is equal to a given value seems to be the common case:

 class EqualKey(Key):
... def __init__(self, pos, val):
... super(EqualKey, self).__init__(lambda x: x[pos] == val)
... 
 items.index(EqualKey(2, 20))
1

Alan

-- 
http://mail.python.org/mailman/listinfo/python-list


Make a .WAV file come out of the left speaker in Windows

2005-07-11 Thread Alan Green
I am writing a Python script that uses the win32all winsound package to
play a .wav file. I the sound come out of the left hand speaker, but
not the right hand speaker.

I've look at some Python sound libraries (PySonic, Audiere, pygame), as
well as any number of command line .wav file players. For differing
reasons, none of these were suitable. Two possiblities are:

(a) Convert the mono .WAV file to a stereo .WAV file that plays out of
the left speaker only, or

(b) Use the win32 ActiveX to adjust the Windows sound output balance
all the way to the left.

Can anybody offer suggestions as to where to start with these two? Does
anybody have other solutions to suggest?

Alan.

-- 
http://mail.python.org/mailman/listinfo/python-list


Reminder: Sydney Python Meetup - March 10

2005-03-09 Thread Alan Green
The Sydney Python Meetup is on again tomorrow, Thursday March 10, at 
6:30pm. The topic is web application frameworks, and we are covering 
four different approaches to building web applications in Python.

What:  Sydney Python Meetup
   Web Application Frameworks
Speakers:
   Casey Whitelaw speaking on CGI
   Mark Rees on WSGI
   Andy Todd on Quixote
   Yours Truly on CherryPy
When:  6:30pm, presentations commencing at 7:00pm
   Thursday, March 10
Where: James Squire Brewhouse
   22 The Promenade King St Wharf
   Sydney, NSW
The presentations will begin at 7:00 and finish at 8:00. Feel free to 
stay and discuss the relative merits of those frameworks and other 
Pythonic topics.

Meals, snacks and drinks are available from the bar.
Further details and RSVP at: http://python.meetup.com/96/events/4239674/
--
Alan Green ([EMAIL PROTECTED])
Cirrus Technologies Pty. Ltd.
http://www.cirrustech.com.au
+61 2 9299 3544 (w)   +61 2 9299 5950 (f)
--
http://mail.python.org/mailman/listinfo/python-announce-list
   Support the Python Software Foundation:
   http://www.python.org/psf/donations.html