Re: [Tutor] Sequences of letter

2010-04-11 Thread Patrick Sabin
So far this is what I have: letras = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"] letra1 = 0 letra2 = 0 letra3 = 0 for i in letras: for j in letras: for k in letras: print letras[letra1]+letras[letra2]+letras[letra3

Re: [Tutor] Sequences of letter

2010-04-11 Thread Mark Tolonen
"Juan Jose Del Toro" wrote in message news:s2i9b44710e1004112212zdf0b052fxe647ba6bb9671...@mail.gmail.com... Dear List; I have embarked myself into learning Python, I have no programming background other than some Shell scripts and modifying some programs in Basic and PHP, but now I want to b

[Tutor] Sequences of letter

2010-04-11 Thread Juan Jose Del Toro
Dear List; I have embarked myself into learning Python, I have no programming background other than some Shell scripts and modifying some programs in Basic and PHP, but now I want to be able to program. I have been reading Alan Gauld's Tutor which has been very useful and I've also been watching

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Chris Fuller
Sorry, should have included a concrete example. Although, as the others have said, I'm not sure how it helps with what you (seem) to want to do. 0 % cat bar.py def the_answer(self): return 42 0 % cat foo.py import bar class A: pass setattr(A, '__call__', bar.the_answer) a=A() print a(

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Chris Fuller
This actually isn't so hard with classes (not instances of the class). Just use setattr(). The first parameter of the function will be the instance, called "self" by convention. This should work with both old and new style There's stuff in the new module for adding stuff to instances, but I

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Steven D'Aprano
On Sun, 11 Apr 2010 10:30:54 pm Ray Parrish wrote: > Hello, > > I am working on some stuff, and I would like to be able to write a > module which can be imported, and after it's been imported I would > like to be able to access it's functions as methods. > > In other words, if I do the import of mo

Re: [Tutor] Speech recognition, and synthesis

2010-04-11 Thread Alan Gauld
"Ray Parrish" wrote Are there any Python libraries that deal with speech recognition, and speech synthesis? Yes. If so, where are they available, Google "python speech recognition synthesis" There are several. I can't recommend any because I've never used them. and are there any ope

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Alan Gauld
"Ray Parrish" wrote I am working on some stuff, and I would like to be able to write a module which can be imported, and after it's been imported I would like to be able to access it's functions as methods. OK, Kind of... In other words, if I do the import of module ISPdetector, I want to

Re: [Tutor] Declaring methods in modules.

2010-04-11 Thread Patrick Sabin
ipAddress = "123.123.123.123" emails = ipAddress.GetEmailAddresses() Not exactly sure, what you want, but maybe something like this? class mystr(str): def GetEmailAddresses(self): return [str(self)] ipAddress = mystr("123.123.123.123") emails = ipAddress.GetEmailAddresses()

[Tutor] Declaring methods in modules.

2010-04-11 Thread Ray Parrish
Hello, I am working on some stuff, and I would like to be able to write a module which can be imported, and after it's been imported I would like to be able to access it's functions as methods. In other words, if I do the import of module ISPdetector, I want to then be able to make calls lik

[Tutor] Speech recognition, and synthesis

2010-04-11 Thread Ray Parrish
Hello, Are there any Python libraries that deal with speech recognition, and speech synthesis? If so, where are they available, and are there any open source versions? Thanks for any help you can be. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/Linu