Re: magic names in python

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, per9000 wrote: > I just used a search engine a little on this topic and I found no > comprehensive list of magic names in python. They are usually mentioned in parts of the docs where the relevant functionality is explained. For example in `Special method names`_ in the r

Re: example: 40286 -> 68204

2007-06-04 Thread Shihpin
Thanks Steven, I will try to decipher that. Shihpin On 6 4 , 1:45, [EMAIL PROTECTED] wrote: > On Jun 3, 5:23 pm, Shihpin <[EMAIL PROTECTED]> wrote: > > Is there a fuction that reverse the digits of a number? > One can use int, str and a slice: > > print int(str(40286)[::-1]) > > -- > Hope this

Re: magic names in python

2007-06-04 Thread Josiah Carlson
per9000 wrote: > So my questions: > * is there a comprehensive list of magic names in python (so far i > know of __init__ and __repr__)? > * are these lists complete or can magic names be added over time (to > the python "core")? > * are magic names the same in different python versions? I don'

Re: Dict naming, global vs local imports, etc. [was Re: *Naming Conventions*]

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, George Sakkis wrote: > While we're at it, although it's not strictly a naming convention > issue I still waste brain cycles on where to put the import statements > that are used only once or twice in a module. Should > (1) all imports be at the global scope at the top of th

Re: int vs long

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Alex Martelli wrote: > Paul Rubin wrote: > >> Dan Bishop <[EMAIL PROTECTED]> writes: >> > If you ever do, it's trivial to write your own enumerate(): >> > def enumerate(seq): >> > index = 0 >> > for item in seq: >> > yield (index,

Re: int vs long

2007-06-04 Thread Peter Otten
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Alex Martelli wrote: > >> Paul Rubin wrote: >> >>> Dan Bishop <[EMAIL PROTECTED]> writes: >>> > If you ever do, it's trivial to write your own enumerate(): >>> > def enumerate(seq): >>> > index = 0 >>> >

Re: int vs long

2007-06-04 Thread Peter Otten
Paul Rubin wrote: > Dan Bishop <[EMAIL PROTECTED]> writes: >> If you ever do, it's trivial to write your own enumerate(): >> def enumerate(seq): >> index = 0 >> for item in seq: >> yield (index, item) >> index += 1 > > That's a heck of a lot slower than the builtin, and if

Re: magic names in python

2007-06-04 Thread per9000
On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, per9000 wrote: > > > > [...] > > > > So another question emerges: > > * is the use of magic names encouraged and/or part of good coding > > practice. > > What do you mean by "use"? Implement them to o

Re: Python memory handling

2007-06-04 Thread Frédéric PICA
Greets, Sorry for my late answer, google groups lost my post... First, thanks you for your explanations about memory handling in the os and python. I've tried with python 2.5 under linux : For the parsing of a 66 Mb xml file with cElementTree : When starting python : 2.1 Mb private memory used imp

Re: Strange behavior in Windows

2007-06-04 Thread Gabriel Genellina
En Sat, 02 Jun 2007 15:31:40 -0300, Jakob Svavar Bjarnason <[EMAIL PROTECTED]> escribió: > I have been trying to switch to Python from other languages such as Perl > and now I have a newbie question. > > I have been trying to run a setup script to install a python library. To > do that I nee

Re: subexpressions (OT: math)

2007-06-04 Thread stef
Gary Herron wrote: > Wildemar Wildenburger wrote: > >> Gary Herron wrote: >> >> >>> Of course not! Angles have units, commonly either degrees or radians. >>> >>> However, sines and cosines, being ratios of two lengths, are unit-less. >>> >>> >>> To understand it: sin

Re: magic names in python

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, per9000 wrote: > On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, per9000 wrote: >> > >> > [...] >> > >> > So another question emerges: >> > * is the use of magic names encouraged and/or part of good coding >> > practice. >>

Re: int vs long

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Peter Otten wrote: > Marc 'BlackJack' Rintsch wrote: > > from itertools import count > from sys import maxint > c = count(maxint) > c.next() >> 2147483647 > c.next() >> -2147483648 >> >> What I find most disturbing here, is that it happens silently. I

Re: Create a new class on the fly

2007-06-04 Thread Josh West
Alex Martelli wrote: > > Thanks for snipping all the actual helpful stuff I posted, it makes SO > much easier for me to be snide! > > You can find a few examples of me demonstrating the subject of your > interest by searching for my name e.g. on video.google.com; searching > for my name on Amazon w

Re: subexpressions (OT: math)

2007-06-04 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > if you are discordant read more :P : > sine is a dimensionless value. > if we expand sine in taylor series sin(x) = x - (x^3)/6 + (x^5)/120 > etc. > you can see that sin can be dimensionless only if x is dimensionless > too. > > I am a professional physicist and a know ab

Re: int vs long

2007-06-04 Thread Peter Otten
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Peter Otten wrote: > >> Marc 'BlackJack' Rintsch wrote: >> >> from itertools import count >> from sys import maxint >> c = count(maxint) >> c.next() >>> 2147483647 >> c.next() >>> -2147483648 >>> >>> What I find most

Re: subexpressions (OT: math)

2007-06-04 Thread Erik Max Francis
Wildemar Wildenburger wrote: > So in each term of the sum you have a derivative of f, which in the > case of the sine function translates to sine and cosine functions at the > point 0. It's not like you're rid of the function just by doing a > polynomial expansion. The only way to *solve* this

Re: subexpressions (OT: math)

2007-06-04 Thread Wildemar Wildenburger
Erik Max Francis wrote: > Wildemar Wildenburger wrote: > > >> So in each term of the sum you have a derivative of f, which in the >> case of the sine function translates to sine and cosine functions at the >> point 0. It's not like you're rid of the function just by doing a >> polynomial exp

Re: int vs long

2007-06-04 Thread Douglas Woodrow
On Mon, 4 Jun 2007 10:50:14, Peter Otten <[EMAIL PROTECTED]> wrote >>> >>> This is fixed in Python2.5: >>> >> Hm, my test above was from 2.5!? > >Then your installation is broken. What does > import itertools itertools >'/usr/local/lib/python2.5/lib-dynload/itertools.so'> > >print? Mayb

Re: magic names in python

2007-06-04 Thread Diez B. Roggisch
per9000 wrote: > On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, per9000 >> wrote: >> > >> > [...] >> > >> > So another question emerges: >> > * is the use of magic names encouraged and/or part of good coding >> > practice. >> >> What do you mean

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently trying to port my web software AFoC > to Windows and have hit a strange problem: it seams that binary files > (PNG images in this case) get distorted by wsgiref. (I have tried both > the C

Re: Non-blocking subprocess call

2007-06-04 Thread Nick Craig-Wood
Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm currently using os.popen in an application of mine, which calls for > non-blocking data, in this fashion: > >self.file = os.popen('echo %s | sudo -S /sw/bin/fink -y install %s' % > (self.passtext, self.packagename), 'r', os.O_NONBLOCK) > > W

making a opc client in Python and use opc server Events

2007-06-04 Thread getelectronic
Hi all I have a sample code to implement opc client in Python. i use a file .py making by makepy with pythonwin for Com Interface. i can get all server in machine, connect to server opc, disconnect, add group, add item, read, write item in server opc. import win32com.client # librairie pour utili

Re: int vs long

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Peter Otten wrote: >> Hm, my test above was from 2.5!? > > Then your installation is broken. What does > import itertools itertools > '/usr/local/lib/python2.5/lib-dynload/itertools.so'> > > print? Python 2.5 (r25:51908, Oct 6 2006, 15:22:41) [GCC 4.1.2 200

Re: subexpressions (OT: math)

2007-06-04 Thread Peter Otten
[EMAIL PROTECTED] wrote: > sine is a dimensionless value. > if we expand sine in taylor series sin(x) = x - (x^3)/6 + (x^5)/120 > etc. > you can see that sin can be dimensionless only if x is dimensionless > too. With y = x^2 = 1/3 pi^2 - 4(cos x - cos(2x)/2^2 + cos(3x)/3^2 - ...) area is dimens

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
Steve Howell je napisao/la: > some European alphabets: > >Spanish -- accented, includes digraphs ch and ll >German -- accented >French -- accented >Italian -- accented, no J/K/W/X/Y > what about slavic languages? in croatian you have five accented letters plus three letters for di

Re: int vs long

2007-06-04 Thread Peter Otten
Douglas Woodrow wrote: > On Mon, 4 Jun 2007 10:50:14, Peter Otten <[EMAIL PROTECTED]> wrote This is fixed in Python2.5: >>> Hm, my test above was from 2.5!? >> >>Then your installation is broken. What does >> > import itertools > itertools >>>'/usr/local/lib/python2.5/lib-dy

Re: Comments appreciated on Erlang inspired Process class.

2007-06-04 Thread Nick Craig-Wood
Brian L. Troutwine <[EMAIL PROTECTED]> wrote: > Lately I've been tinkering around with Erlang and have begun to sorely want > some of its features in Python, mostly the ease at which new processes can > be > forked off for computation. To that end I've coded up a class I call, > boringly en

Re: int vs long

2007-06-04 Thread Peter Otten
Marc 'BlackJack' Rintsch wrote: > Seems to be the same Python version, just build three days earlier and > with a different GCC version.  Weird. Indeed. Also, it seems to prove the explanation wrong that I just in response to Douglas' post... Peter -- http://mail.python.org/mailman/listinfo/py

RE: c[:]()

2007-06-04 Thread Warren Stringer
> "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > || Warren Stringer wanted to call the functions just for the side effects > | without interest in the return values. So building a list of return > | values which is immediately thrown away is a waste of t

Re: c[:]()

2007-06-04 Thread Erik Max Francis
Warren Stringer wrote: > demo4:demo.stop() > ball.smooth() > video.live() > preset.video.straight() > view.front3d() > luma.real() > seq[:]lock(1) You're way off in la-la land, now. > It sounds like li

ctypes: error passing a list of str to a fortran dll

2007-06-04 Thread luis
I'm using ctypes to call a fortran dll from python. I have no problems passing integer and double arryas, but I have an error with str arrys. For example: StringVector = c_char_p * len(id) # id is a list of strings Id_dat=StringVector() for i in range(len(Id)): ...Id_dat[i]=id[i] n=c_int(le

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Steve Howell
--- [EMAIL PROTECTED] wrote: > what about slavic languages? > in croatian you have five accented letters plus > three letters for > digrahps. russian, bulgarian, serbian, macedonian, > ukranian etc. use > cyrilic alphabet (lets not forget that russia isn't > that small - > around 150 million peopl

Re: subexpressions (OT: math)

2007-06-04 Thread Wildemar Wildenburger
Peter Otten wrote: > With y = x^2 = 1/3 pi^2 - 4(cos x - cos(2x)/2^2 + cos(3x)/3^2 - ...) > > area is dimensionless, too, I suppose. > Ehr, ... maybe this is obvious, but I don't see it: Please explain the second equality sign. /W -- http://mail.python.org/mailman/listinfo/python-list

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Might this be a bug in wsgiref ? I will hopefully be able to do some > more testing, ... The following simple CGI script should, AFAIK, on any platform, output exactly the file specified in code. It does not on Apache 2 on Window

Re: subexpressions (OT: math)

2007-06-04 Thread Peter Otten
Wildemar Wildenburger wrote: > Peter Otten wrote: >> With y = x^2 = 1/3 pi^2 - 4(cos x - cos(2x)/2^2 + cos(3x)/3^2 - ...) >> >> area is dimensionless, too, I suppose. >> > > Ehr, ... maybe this is obvious, but I don't see it: Please explain the > second equality sign. I know not much more abo

Re: Python 2.5.1 broken os.stat module

2007-06-04 Thread Joe Salmeri
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> It appears that you may have missed part of my tests. Sorry it was such >> a >> long reply but I was trying to provide a lot of detail so that others had >> a >> clear understanding of what was going on. > > Ple

Re: Python 2.5.1 broken os.stat module

2007-06-04 Thread Joe Salmeri
There is a conflict with the answers that you and Terry have given. The original issue I raised was that I Python 2.5.1 and Windows did not have the same textual represenation for a localize date. You have stood true to the statements that Python 2.5.1 is correct and that previous versions were

Re: Python 2.5.1 broken os.stat module

2007-06-04 Thread Joe Salmeri
Perspective is often the source of problems with communication. You view timezones and DST as offsets from GMT. I understand and respect that perspective. When I think of timezones and DST I think of the timezone setting and the DST setting in Windows. These settings are two separate settings

Re: another thread on Python threading

2007-06-04 Thread sturlamolden
On Jun 4, 3:10 am, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I've recently been working on an application[1] which does quite a bit > > of searching through large data structures and string matching, and I > > was thinking that it would help to put some of this CPU-in

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
> Agreed, but FWIW, if you compared Slavic-writing > people to Chinese-writing people, I would think that a > higher percentage of Slavic-writing people would be > bilingual in terms of their ability to write code in > non-Slavic alphabets, due to various > cultural/geographical factors. of course

Re: subexpressions (OT: math)

2007-06-04 Thread Wildemar Wildenburger
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > >> sine is a dimensionless value. >> if we expand sine in taylor series sin(x) = x - (x^3)/6 + (x^5)/120 >> etc. >> you can see that sin can be dimensionless only if x is dimensionless >> too. >> > > With y = x^2 = 1/3 pi^2 - 4(cos x - cos(2

Re: subexpressions (OT: math)

2007-06-04 Thread Steve Howell
--- Peter Otten <[EMAIL PROTECTED]> wrote: > > I know not much more about Fourier series than that > they do exist, so let me > refer you to > > http://en.wikipedia.org/wiki/Fourier_series > I'd like to try to bring this thread back full circle (or maybe at least 7*pi/4). 1) OP posted an ex

How to do this with groupby (or otherwise)? (Was: iterblocks cookbook example)

2007-06-04 Thread Gerard Flanagan
On Jun 2, 10:47 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Jun 2, 10:19 am, Steve Howell <[EMAIL PROTECTED]> wrote: > > > George Sakkis produced the following cookbook recipe, > > which addresses a common problem that comes up on this > > mailing list: > > ISTM, this is a common mailing

Re: subexpressions (OT: math)

2007-06-04 Thread Steve Howell
--- Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > > Oh my, remember when we used to discuss murderous > snakes and silly > British comedians on this group? > I hardly do ... > /W Although all of us are mere amateurs in this business of making parameters when it's circles in question I

pyhon 2.5.1 build fails

2007-06-04 Thread Robin Becker
I am getting an error while building python-2.5.1 on a freebsd 6.1 machine as a normal user ./configure --prefix=/home/me/mypython --enable-unicode=ucs2 seems to work fine, but make install fails whilst running Compiling /home/my/mypython/lib/python2.5/test/test_module.py ... Compiling /home/me

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread M�ta-MCI
Et le klingon ? Please, don't forget klingons SVP, n'oubliez pas les klingons ;o) -- http://mail.python.org/mailman/listinfo/python-list

Python 3000: Standard API for archives?

2007-06-04 Thread samwyse
I'm a relative newbie to Python, so please bear with me. There are currently two standard modules used to access archived data: zipfile and tarfile. The interfaces are completely different. In particular, script wanting to analyze different types of archives must duplicate substantial piece

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread montyphyton
Méta-MCI je napisao/la: > Et le klingon ? > > Please, don't forget klingons > SVP, n'oubliez pas les klingons > > ;o) je pense que le klingon utilise les mems lettres comme l'anglais -- http://mail.python.org/mailman/listinfo/python-list

Re: excel library without COM

2007-06-04 Thread John Machin
On Jun 4, 3:52 pm, yuce <[EMAIL PROTECTED]> wrote: > i think this one works pretty nice:http://www.python.org/pypi/xlrd Sure does :-) However the "rd" in "xlrd" is short for "ReaD". As Waldemar suggested, "xlwt" ("wt" as in WriTe) is more like what the OP needs. Cheers, John -- http://mail.pyth

Re: pyhon 2.5.1 build fails

2007-06-04 Thread Robin Becker
Robin Becker wrote: > I am getting an error while building python-2.5.1 on a freebsd 6.1 machine as > a > normal user > > ./configure --prefix=/home/me/mypython --enable-unicode=ucs2 > > seems to work fine, but make install fails whilst running > > Compiling > /home/my/mypython/lib/python2.5/t

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Steve Howell
--- [EMAIL PROTECTED] wrote: > > Méta-MCI je napisao/la: > > Et le klingon ? > > > > Please, don't forget klingons > > SVP, n'oubliez pas les klingons > > > > ;o) > > je pense que le klingon utilise les mems lettres > comme l'anglais > Oui, mais en tous case, dans l'Enterprise on doit utilise

How do you htmlentities in Python

2007-06-04 Thread js
Hi list. If I'm not mistaken, in python, there's no standard library to convert html entities, like & or > into their applicable characters. htmlentitydefs provides maps that helps this conversion, but it's not a function so you have to write your own function make use of htmlentitydefs, probabl

RE: c[:]()

2007-06-04 Thread Roland Puntaier
Hi, I have started to look into the last postings. It is funny and sad how people talking the same language cannot understand each other. I have become curious on what exactly you mean. Warren, can you please restate your point. When doing so, please define every identifier or non-plain english

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread olive
Lol! What is a "sharp hair boss" ? My boss does not look like a punk ! But he does want me to dance "la Java". -- http://mail.python.org/mailman/listinfo/python-list

python for EE CAD program

2007-06-04 Thread chewie54
Hi All, I have read some posts on this subject but I haven't been able to make a decision whether to use Python or not. I'm considering converting a Java CAD program to Python/C with wxWdigets for the GUI. I don't have good answers for: 1) Can I use py2exe or pyinstaller to produce an executab

Re: magic names in python

2007-06-04 Thread markacy
On 4 Cze, 08:43, per9000 <[EMAIL PROTECTED]> wrote: > Hi, > > I recently started working a lot more in python than I have done in > the past. And I discovered something that totally removed the pretty > pink clouds of beautifulness that had surrounded my previous python > experiences: magic names (

Using pyTTS with other languages.

2007-06-04 Thread simon kagwe
Hi, I would like to create a TTS program for a local (Kenyan) language. I have installed pyTTS on my computer and it works perfectly with English sentences. However, my language is very different from English (sylabbles, pronounciation etc.) How can I go about having a TTS program that correctly s

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread ahlongxp
On Jun 4, 11:54 am, Ross Ridge <[EMAIL PROTECTED]> wrote: > Steve Howell <[EMAIL PROTECTED]> wrote: > > >about Japan: > >major linguistic influences: Chinese, English, > >Dutch > > English and Dutch are minor linguistic influences. > Obviously. But language evolves. > > >Asia: > > > Python

Re: python for EE CAD program

2007-06-04 Thread Diez B. Roggisch
chewie54 wrote: > Hi All, > > I have read some posts on this subject but I haven't been able to make > a decision whether to use Python or not. > > I'm considering converting a Java CAD program to Python/C with > wxWdigets for the GUI. > > I don't have good answers for: > > 1) Can I use py2ex

Re: `yield` in a `try/finally` block, pre-Python 2.5

2007-06-04 Thread Adam Atlas
On Jun 4, 1:49 am, yuce <[EMAIL PROTECTED]> wrote: > I had the same problem, you can > see:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/130004 > for a solution. > > Happy hacking, > > Yuce Thanks. I thought of doing something like that, but in my program, it's important that the order

python for EE CAD program

2007-06-04 Thread chewie54
Hi All, I have read some posts on this subject but I haven't been able to make a decision whether to use Python or not. I'm considering converting a Java CAD program to Python/C with wxWdigets for the GUI. I don't have good answers for: 1) Can I use py2exe or pyinstaller to produce an executab

Re: How do you htmlentities in Python

2007-06-04 Thread Adam Atlas
As far as I know, there isn't a standard idiom to do this, but it's still a one-liner. Untested, but I think this should work: import re from htmlentitydefs import name2codepoint def htmlentitydecode(s): return re.sub('&(%s);' % '|'.join(name2codepoint), lambda m: name2codepoint[m.group(1)], s

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ross Ridge <[EMAIL PROTECTED]> wrote: >Steve Howell <[EMAIL PROTECTED]> wrote: >>about Japan: >>major linguistic influences: Chinese, English, >>Dutch > >English and Dutch are minor linguistic influences. . .

Re: python unix install, sqlite3

2007-06-04 Thread vasudevram
On May 29, 11:40 pm, Simon <[EMAIL PROTECTED]> wrote: > On May 29, 7:05 am, vasudevram <[EMAIL PROTECTED]> wrote: > > > > > > > On May 29, 5:52 pm, Simon <[EMAIL PROTECTED]> wrote: > > > > I installed the source code on unix for python 2.5.1. The install went > > > mainly okay, except for some fail

Re: another thread on Python threading

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 9:10 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > If you are doing string searching, implement the algorithm in C, and > call out to the C (remembering to release the GIL). I considered that, but...ick! The whole reason I'm writing this program in Python in the first place is so I

Re: python for EE CAD program

2007-06-04 Thread chewie54
On Jun 4, 9:56 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > chewie54 wrote: > > Hi All, > > > I have read some posts on this subject but I haven't been able to make > > a decision whether to use Python or not. > > > I'm considering converting a Java CAD program to Python/C with > > wxWdigets

Re: Using pyTTS with other languages.

2007-06-04 Thread kyosohma
On Jun 4, 8:17 am, simon kagwe <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to create a TTS program for a local (Kenyan) language. I have > installed pyTTS on my computer and it works perfectly with English sentences. > However, my language is very different from English (sylabbles, pronouncia

Re: How to do this with groupby (or otherwise)? (Was: iterblocks cookbook example)

2007-06-04 Thread Gerard Flanagan
On Jun 4, 1:52 pm, Gerard Flanagan <[EMAIL PROTECTED]> wrote: > On Jun 2, 10:47 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > > > On Jun 2, 10:19 am, Steve Howell <[EMAIL PROTECTED]> wrote: > > > > George Sakkis produced the following cookbook recipe, > > > which addresses a common problem

Re: Python 3000: Standard API for archives?

2007-06-04 Thread Chuck Rhode
samwyse wrote this on Mon, 04 Jun 2007 12:02:03 +. My reply is below. > I think it would be a good thing if a standardized interface > existed, similar to PEP 247. This would make it easier for one > script to access multiple types of archives, such as RAR, 7-Zip, > ISO, etc. Gee, it would

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Ross Ridge
Steve Howell <[EMAIL PROTECTED]> wrote: >I'm wondering if all the English keywords in Python >would present too high a barrier for most Chinese >people--def, if, while, for, sys, os, etc. So you >might need to go even further than simply allowing >identifiers to be written in Simplified-Chinese.

Re: Python 3000: Standard API for archives?

2007-06-04 Thread Tim Golden
Chuck Rhode wrote: > samwyse wrote this on Mon, 04 Jun 2007 12:02:03 +. My reply is > below. > >> I think it would be a good thing if a standardized interface >> existed, similar to PEP 247. This would make it easier for one >> script to access multiple types of archives, such as RAR, 7-Zip,

Pyrex: problem with blanks in string

2007-06-04 Thread Hans Terlouw
Hi, When trying to wrap C code using Pyrex, I encountered a strange problem with a piece of pure Python code. I tried to isolate the problem. The following code causes Pyrex to generate C code which gcc cannot compile: class Axis: axtype = "unknown type of axis" def __init__(self):

wxPython splitwindow with interpreter on bottom

2007-06-04 Thread chewie54
Hi all, Does anyone know of an example of wxPython source code that shows how to put a python shell (interpreter) in a bottom window with a graphical application in the top window? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Embedding Python in C

2007-06-04 Thread mistabean
Hello, first of all, I am a programming newbie, especially in python... Onwards to the problem, I have been having difficulty embedding a python module into my C/C++ program. (just a test program before moving on into the real thing). I have been making test runs using the codes from http://docs.

Re: python for EE CAD program

2007-06-04 Thread Diez B. Roggisch
> Hello Diez, > > I did look at PythonCad but the distribution and install methods for > Windows is not user freindly. Since the public domain software, I > don't think they protect the source code either. The subject of code obfuscation in python has been beaten to death quite a few times on th

Re: Using pyTTS with other languages.

2007-06-04 Thread simon kagwe
gmail.com> writes: > It describes how to use mis-spelled words to force correct > pronunciation as well as how to do it with XML. > > Mike > Thanks Mike. I had already read that article. I thought the mis-spelling and XML are meant to deal with pronunciation of English words. Will it really

Re: python for EE CAD program

2007-06-04 Thread Grant Edwards
On 2007-06-04, chewie54 <[EMAIL PROTECTED]> wrote: > 1) Can I use py2exe or pyinstaller to produce an executable >for Linux, Windows, and Mac? If not, is there a way it can be >done? > > 2) Is there any way to protect the source code, like obfuscation? > > 3) Memory footprint of applic

pychecker

2007-06-04 Thread puff
I'm new to pychecker. Some of my code generates the following No class attribute (HWND) found While HWND is not an attribute of the class, it IS an attribute of the instance created (my class is one of several classes used to create the new class). Can I use __pychecker__ to selectively supres

Re: Pyrex: problem with blanks in string

2007-06-04 Thread Michael Hoffman
Hans Terlouw wrote: > When trying to wrap C code using Pyrex, I encountered a strange problem > with a piece of pure Python code. I tried to isolate the problem. The > following code causes Pyrex to generate C code which gcc cannot compile: It works for me. Try posting your error messages and v

Re: FAQ: how to vary the byte offset of a field of a ctypes.Structure

2007-06-04 Thread p . lavarre
> > http://docs.python.org/lib/module-pickle.html > > ... concise Python ways of pickling and unpickling > > the (0xFF ** N) possible ways of > > packing N strings of byte lengths of 0..xFE together ... Aye, looks like an exercise left open for the student to complete: >>> pickle.dumps("") "S''\n

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, ahlongxp <[EMAIL PROTECTED]> wrote: . . . >I'm a Chinese. >Language/English is really a big problem for Chinese programmers. >If python can be written in Chinese, it may become the most popul

Re: How do you htmlentities in Python

2007-06-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Adam Atlas <[EMAIL PROTECTED]> wrote: >As far as I know, there isn't a standard idiom to do this, but it's >still a one-liner. Untested, but I think this should work: > >import re >from htmlentitydefs import name2codepoint >def htmlentitydecode(s): >return re.su

Re: How do you htmlentities in Python

2007-06-04 Thread Thomas Jollans
"Adam Atlas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As far as I know, there isn't a standard idiom to do this, but it's > still a one-liner. Untested, but I think this should work: > > import re > from htmlentitydefs import name2codepoint > def htmlentitydecode(s): >retu

Re: python for EE CAD program

2007-06-04 Thread chewie54
On Jun 4, 10:58 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Hello Diez, > > > I did look at PythonCad but the distribution and install methods for > > Windows is not user freindly. Since the public domain software, I > > don't think they protect the source code either. > > The subject of

Re: magic names in python

2007-06-04 Thread Facundo Batista
Josiah Carlson wrote: > I don't believe that there is a full list of all __magic__ methods. The > operator module has a fairly extensive listing of functions that call > such methods, but I know that some have been left out. There IS a full documentation of this special methods:: http://doc

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Wildemar Wildenburger
Ross Ridge wrote: > Translating keywords and standard identifiers into Chinese could make > learning Python even more difficult. It would probably make things > easier for new programmers, but I don't know if serious programmers would > actually prefer programming using Chinese keywords. It would

Re: python for EE CAD program

2007-06-04 Thread Chris Mellon
On 6/4/07, chewie54 <[EMAIL PROTECTED]> wrote: > On Jun 4, 10:58 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > Hello Diez, > > > > > I did look at PythonCad but the distribution and install methods for > > > Windows is not user freindly. Since the public domain software, I > > > don't th

Re: python for EE CAD program

2007-06-04 Thread Grant Edwards
On 2007-06-04, Chris Mellon <[EMAIL PROTECTED]> wrote: >> Your opinions are noted, thank you, but I don't agree with >> you. There are portions of the code that are under review for >> patents and as such need to be protected. > > For the record: This is not true. If you've already applied > for t

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Steve Howell
--- olive <[EMAIL PROTECTED]> wrote: > What is a "sharp hair boss" ? > "Sharp hair boss" came out from my translation into French of "pointy-haired boss." Wikipedia tells me I should have said "Boss a tête de pioche." Here are some links, if you've never had the pleasure of reading Dilbert:

Graph plotting module

2007-06-04 Thread Viewer T.
Is there a python module anywhere out there that can plot straight line graphs, curves (quadratic, etc). If anyone knows where I can download one, please let me know. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you htmlentities in Python

2007-06-04 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Adam Atlas <[EMAIL PROTECTED]> wrote: >As far as I know, there isn't a standard idiom to do this, but it's >still a one-liner. Untested, but I think this should work: > >import re >from htmlentitydefs import name2codepoint >def htmlentitydecode(s): >return re.su

Python-URL! - weekly Python news and links (Jun 4)

2007-06-04 Thread Gabriel Genellina
QOTW: "Stop thinking of three lines as 'extensive coding' and your problem disappears immediately." - Steve Holden "Hey, did you hear about the object-oriented version of COBOL? They call it 'ADD ONE TO COBOL'." - Tim Roberts EuroPython: Registration is open! http://www.europyth

Re: How do you htmlentities in Python

2007-06-04 Thread Matimus
On Jun 4, 6:31 am, "js " <[EMAIL PROTECTED]> wrote: > Hi list. > > If I'm not mistaken, in python, there's no standard library to convert > html entities, like & or > into their applicable characters. > > htmlentitydefs provides maps that helps this conversion, > but it's not a function so you have

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Ross Ridge
Ross Ridge wrote: > Translating keywords and standard identifiers into Chinese could make > learning Python even more difficult. It would probably make things > easier for new programmers, but I don't know if serious programmers would > actually prefer programming using Chinese keywords. It would

get_traceback

2007-06-04 Thread half . italian
Hi, Is there a function or idoim for returning an exception/traceback rather than just printing it to stdout? I'm running a deamon where stdout is going to /dev/null, and I'm not even watching it..until now. All the functions I found in traceback and sys seemed only to print the error rather tha

webbrowser.open launches firefox in background

2007-06-04 Thread BartlebyScrivener
Hello, On Debian Etch, when I use the webbrowser.open module to launch firefox with a url, it opens UNDER gnome terminal in the background. If I just launch firefox from the commandline, it opens in the foreground. Any ideas about why? Is there a command option I'm missing. Thanks, Rick -- h

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Roel Schroeven
olive schreef: > Lol! > > What is a "sharp hair boss" ? Pointy-haired boss, see http://en.wikipedia.org/wiki/Pointy_Haired_Boss -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven -- http://mail.python.org/mailman/list

Re: python for EE CAD program

2007-06-04 Thread chewie54
On Jun 4, 12:47 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-06-04, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > > >> Your opinions are noted, thank you, but I don't agree with > >> you. There are portions of the code that are under review for > >> patents and as such need to be protecte

safe cgi parameter

2007-06-04 Thread Robin Becker
I'm trying to pass xml into a cgi script and have some problems because I both want to escape all my inputs (to avoid the possibility of an html injection attack) and also allow my xml to be obtained in its original form. I thought of this from xml.sax.saxutils import escape as xmlEscape class

  1   2   >