Generating sin/square waves sound

2011-12-29 Thread Paulo da Silva
Hi, Sorry if this is a FAQ, but I have googled and didn't find any satisfatory answer. Is there a simple way, preferably multiplataform (or linux), of generating sinusoidal/square waves sound in python? Thanks for any answers/suggestions. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help in rotate 13 program

2011-12-29 Thread Sayantan Datta
On Thu, Dec 29, 2011 at 10:09 PM, Dave Angel wrote: > On 12/29/2011 11:25 AM, Sayantan Datta wrote: > >> On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote: >> >> On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta >>> wrote: >>> for line in sys.stdin : for char in line : >>

Re: db agnostic admin for Flask?

2011-12-29 Thread umchaselee
I was considering building an admin that would consist of two components, a totally separate HTML/CSS/JS frontend that presumed API endpoints, and a backend written in Tornado (similar to Flask in a lot of ways) that caught all of the presumed endpoints and performed the db operations. The idea

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Chris Angelico
On Fri, Dec 30, 2011 at 10:24 AM, Lie Ryan wrote: > Another drawback of it is that it looks misleadingly similar to C++ > namespace notation. Granted, but I don't see that as a drawback. The current notation is just as similar to C's pointer-dereference notation, but that hasn't led people to thi

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Lie Ryan
On 12/30/2011 12:23 AM, Steven D'Aprano wrote: On Thu, 29 Dec 2011 03:55:14 -0800, Eelco wrote: I would argue that the use of single special characters to signal a relatively complex and uncommon construct is exactly what I am trying to avoid with this proposal. This would be the proposal to

Re: Py-dea: Streamline string literals now!

2011-12-29 Thread Chris Angelico
On Fri, Dec 30, 2011 at 10:19 AM, Lie Ryan wrote: > right and you can generalize this idea even further Don't stop generalizing. Everything should be custom. http://rosuav.com/1/?id=683 ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Py-dea: Streamline string literals now!

2011-12-29 Thread Lie Ryan
On 12/29/2011 12:44 PM, Dan Sommers wrote: On Wed, 28 Dec 2011 22:54:16 +, Steven D'Aprano wrote: On Wed, 28 Dec 2011 11:36:17 -0800, Rick Johnson wrote: The point is people, we should be using string delimiters that are ANYTHING besides " and '. Stop being a sheep and use your brain! "

Augmented online documentation

2011-12-29 Thread Aryeh Leib Taurog
I have created for myself a small google chrome extension which generates a treeview toc pane of the online python docs as well as the matplotlib docs. This is intended to facilitate doc navigation, much the same way the navigation pane in a chm viewer does. Read more and install it at https://bi

PySide / PyQt autocompletion in IDEs

2011-12-29 Thread Merwin
Hi, I would like to work with PyQt / PySide, but there is a small problem : methods arguments are not completed by IDE's autocompletion. When, typing "PySide.", I correctly get the module's attributes, but when I want to see what arguments are expected to a constructor / method, all I get is

Re: pickling instances of metaclass generated classes

2011-12-29 Thread Ian Kelly
On Thu, Dec 29, 2011 at 2:55 AM, lars van gemerden wrote: > Hello, > > Can someone help me with the following: > > I am using metaclasses to make classes and these classes to make > instances. Now I want to use multiprocessing, which needs to pickle > these instances. > > Pickle cannot find the cl

Re: Which libraries for Python 2.5.2 [SOLVED]

2011-12-29 Thread W. eWatson
On 12/29/2011 9:44 AM, Ian Kelly wrote: On Thu, Dec 29, 2011 at 10:04 AM, Dennis Lee Bieber wrote: On Thu, 29 Dec 2011 09:54:48 -0500, Dennis Lee Bieber wrote: Talking to myself.. According to the pop-up I get (Win7) when supplying an invalid argument, Maybe regs

Re: About instance.name look up order

2011-12-29 Thread Ian Kelly
On Thu, Dec 29, 2011 at 9:07 AM, Prim wrote: > class C: >    def x(self): >        print 'x method' >    def __getattr__(self, attr): >        print 'in __getattr__ method' >        return attr > c = C() > c.x --> print in __getattr__ method, then throw TypeError: 'str' > object is not callable >

Re: About instance.name look up order

2011-12-29 Thread Kev Dwyer
Prim wrote: > First, sorry about my poor english. > Put these in IPython under ubuntu. > - > class C: > def __init__(self): > self.x = 1 > def print(self): > print self.x > c = C() > c.x --

Re: Which libraries for Python 2.5.2

2011-12-29 Thread Ian Kelly
On Thu, Dec 29, 2011 at 10:04 AM, Dennis Lee Bieber wrote: > On Thu, 29 Dec 2011 09:54:48 -0500, Dennis Lee Bieber > wrote: > >        Talking to myself.. > >> >>       According to the pop-up I get (Win7) when supplying an invalid >>argument, >> >        Maybe regsrv32 was rewritten for Win7 64b

Re: Which libraries for Python 2.5.2

2011-12-29 Thread W. eWatson
On 12/29/2011 9:04 AM, Dennis Lee Bieber wrote: On Thu, 29 Dec 2011 09:54:48 -0500, Dennis Lee Bieber wrote: Talking to myself.. It's the best way to get people to listen to you. :-) According to the pop-up I get (Win7) when supplying an invalid argument, Maybe r

Re: Which libraries for Python 2.5.2

2011-12-29 Thread W. eWatson
On 12/29/2011 6:54 AM, Dennis Lee Bieber wrote: On Wed, 28 Dec 2011 21:56:59 -0800, "W. eWatson" wrote: It didn't like that either. Got "msvcp71.dll was located but the dll server entry was not found. File could not be registered." Arguments are /u,/s/i/n. According to the pop-up

Re: Help in rotate 13 program

2011-12-29 Thread Dave Angel
On 12/29/2011 11:25 AM, Sayantan Datta wrote: On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote: On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta wrote: for line in sys.stdin : for char in line : sys.stdout.write(rotate13_letter(char)) cat sample.html | python rot13.py rot13.

Re: Help in rotate 13 program

2011-12-29 Thread Chris Angelico
On Fri, Dec 30, 2011 at 3:25 AM, Sayantan Datta wrote: > did that, but the output file is still empty? Does the fault lie somewhere > else? I'm not sure if it's a copy-paste problem, but check your indentation: your "if __name__" line seems to be indented, it should be flush left. Indentation mak

Re: Help in rotate 13 program

2011-12-29 Thread Sayantan Datta
On Thu, Dec 29, 2011 at 5:34 PM, Chris Angelico wrote: > On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta > wrote: > > for line in sys.stdin : > > for char in line : > > sys.stdout.write(rotate13_letter(char)) > > > > cat sample.html | python rot13.py rot13.html > > You're reading from

About instance.name look up order

2011-12-29 Thread Prim
First, sorry about my poor english. Put these in IPython under ubuntu. - class C: def __init__(self): self.x = 1 def print(self): print self.x c = C() c.x --> 1, so c.x mean a attr of c named

Re: Get Class properties

2011-12-29 Thread Emeka
Chris, Thanks a million! Regards, Emeka On Thu, Dec 29, 2011 at 1:27 AM, Chris Angelico wrote: > On Wed, Dec 28, 2011 at 11:13 PM, Emeka wrote: > > Hello All, > > > > I have seen what I am looking for.. __dict__. > > > > Yep! You may also want to look at the dir() function. > > Chris Angelico

Re: Good notation for showing MVC interactions (i.e. Django)

2011-12-29 Thread Alec Taylor
An example of a BPMN2 diagram with swimlanes, which I created for a project: http://i40.tinypic.com/262r6nr.jpg What I am looking for is something suited towards showing architecture bounds and the interactions between each section of MVC. > I find that when thinking something through at the whit

Re: Where does this readOne() method come from?

2011-12-29 Thread tinnews
Chris Angelico wrote: > On Thu, Dec 29, 2011 at 6:04 AM, wrote: > > In the (rather sparse) documentation for the vobject package it has, > > in the section about parsing iCalendar objects, the following:- > > > >    >>> parsedCal = vobject.readOne(icalstream) > > Presumably you have this vobjec

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Eelco
On Dec 29, 2:23 pm, Steven D'Aprano wrote: > On Thu, 29 Dec 2011 03:55:14 -0800, Eelco wrote: > > I would argue that the use of single special characters to signal a > > relatively complex and uncommon construct is exactly what I am trying to > > avoid with this proposal. > > This would be the pro

Good notation for showing MVC interactions (i.e. Django)

2011-12-29 Thread Alec Taylor
Good morning, I'm developing various websites and functionality to cater to various different use-cases up in Django. Is there a good notation for showing what behaviour is at each stage, i.e. using swimlanes? I use BPMN 2 notation for everything, but I feel I am overusing this, and that there w

Which library for audio playback ?

2011-12-29 Thread Jérôme
I'm writing a small application that plays sound through the speakers. The sounds are juste sine waves of arbitrary frequency I create in the code, not sample .wav files. I didn't expect the choice for an audio library to be that complicated. There are several libraries, and none of them seems to

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Steven D'Aprano
On Thu, 29 Dec 2011 03:55:14 -0800, Eelco wrote: > I would argue that the use of single special characters to signal a > relatively complex and uncommon construct is exactly what I am trying to > avoid with this proposal. This would be the proposal to change the existing head, *tail = sequen

Re: Help in rotate 13 program

2011-12-29 Thread Peter Otten
Sayantan Datta wrote: > please help me, this code doesn't work, > the output file comes out to be empty. How do i fix it? and where is it > going wrong? I don't know if that's a copy-n-paste error: the indentation of > if __name__ == '__main__' : > for line in sys.stdin : > for char

Re: logging.getLogger( __name__ )

2011-12-29 Thread Ben Finney
Ram writes: > How does this line work? What line? Please present some code in an example that we can run. Make the example as small as possible so it's clear what you are asking about. -- \ “See, in my line of work you gotta keep repeating things over | `\ and over and over agai

Re: Help in rotate 13 program

2011-12-29 Thread Chris Angelico
On Thu, Dec 29, 2011 at 10:48 PM, Sayantan Datta wrote: >     for line in sys.stdin : >       for char in line : > sys.stdout.write(rotate13_letter(char)) > > cat sample.html | python rot13.py rot13.html You're reading from stdin, which is correct, but you're writing to stdout and not redirecting

Re: Help in rotate 13 program

2011-12-29 Thread Robert Kern
On 12/29/11 11:48 AM, Sayantan Datta wrote: cat sample.html | python rot13.py rot13.html cat sample.html | python rot13.py > rot13.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as

Re: Pythonification of the asterisk-based collection packing/unpacking syntax

2011-12-29 Thread Eelco
On Dec 28, 11:29 pm, Lie Ryan wrote: > On 12/28/2011 11:08 PM, Eelco wrote: > > > I personally feel any performance benefits are but a plus; they are > > not the motivating factor for this idea. I simply like the added > > verbosity and explicitness, thats the bottom line. > > Any performance bene

Help in rotate 13 program

2011-12-29 Thread Sayantan Datta
please help me, this code doesn't work, the output file comes out to be empty. How do i fix it? and where is it going wrong? ==rot13.py== #!/usr/bin/env python import sys import string CHAR_MAP=dict(zip(string.ascii_lowercase, string.ascii_lowercase[13:26] + string.ascii_

Re: pickling instances of metaclass generated classes

2011-12-29 Thread Robert Kern
On 12/29/11 9:55 AM, lars van gemerden wrote: Hello, Can someone help me with the following: I am using metaclasses to make classes and these classes to make instances. Now I want to use multiprocessing, which needs to pickle these instances. Pickle cannot find the class definitions of the ins

pickling instances of metaclass generated classes

2011-12-29 Thread lars van gemerden
Hello, Can someone help me with the following: I am using metaclasses to make classes and these classes to make instances. Now I want to use multiprocessing, which needs to pickle these instances. Pickle cannot find the class definitions of the instances. I am trying to add a line to the __new__