Embeding Py: failed to instantiate a class

2005-03-22 Thread Brano Zarnovican
Hi ! I need to import a module and create an instance of a class from that module (in C). import mod o = mod.klass() (mod.klass is a subclass of tuple) When I receive a class object from the module.. module = PyImport_ImportModule("mod") cls = PyObject_GetAttrString(module, "klass") ..it fail

Re: How to use subprocess

2005-03-22 Thread Michele Simionato
I am not sure how safe it is, but on Linux I have just copied subprocess.py in my 2.3 installation and it worked in all the cases I tried. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the library reference?

2005-03-22 Thread nicke
[...] >I could > have formulated myself a bit annorlund though, ... uups, forgot to look up the word that I directly just didn't come up with; annorlunda is swedish for differently -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the library reference?

2005-03-22 Thread nicke
On Tue, 22 Mar 2005 23:30:51 -0500 Peter Hansen <[EMAIL PROTECTED]> wrote: > Scott David Daniels wrote: > > nicke wrote: > >> If it really is like this it is uncoherent and quite stupid :P > > > > Name-calling won't make anyone more likely to help you out. This is a > > _collective_ effort. You

Re: How to use subprocess

2005-03-22 Thread Fredrik Lundh
Dennis Lee Bieber wrote: > Pardon the question, but which version of Python /has/ a > "subprocess" module? Is it new with 2.4? yes. for earlier versions, you can get a pure-Python Unix implementation here: http://www.lysator.liu.se/~astrand/popen5/ and a windows installer here: http:/

Re: multi-threaded list update

2005-03-22 Thread Mike Rovner
Peter Hansen wrote: (But if you can accept those drawbacks, keep doing what you're doing. Also consider searching the archives for discussions involving the "dis" module (google for "dis.dis" maybe?) and see how to learn for yourself what is atomic and what's not.) Thanks, Peter. I googled groups o

Re: Getting the word to conventional programmers

2005-03-22 Thread Roose
> Except from a the standard, powerful, > looks-good-everywhere-and-has-a-tree-widget GUI toolkit? :) > > Seriously, I think this is *very* important. Yes, and a modern toolset/IDE. Generators and decorators and all that are nice, but their usefulness pales in comparison to having a decent IDE or

{VIRUS?} Returned mail: see transcript for details

2005-03-22 Thread mojo
Warning: This message has had one or more attachments removed. Warning: Please read the "VirusWarning.txt" attachment(s) for more information. Your message was not delivered due to the following reason: Your message could not be delivered because the destination computer was unreachable within th

Re: Building Time Based Bins

2005-03-22 Thread Michael Spencer
MCD wrote: I've mostly been racking my brain with this bit of code: newtm = ((klock + 4) // 5 * 5 ) % 2400 You might want to take another look at the first reply I sent you: it contains a function that does this: def groupkey(data): """Groups times by 5 min resolution. Note this version does

Re: .pth files?

2005-03-22 Thread Bengt Richter
On 22 Mar 2005 09:29:39 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I'm unclear on how .pth files work. Some posts imply they can be >arbitrarily named, as long as they include the .pth extension, and can >exist anywhere in the current sys.path. Other documentation seems to >imply tha

Re: Python limericks (was Re: Text-to-speech)

2005-03-22 Thread Bengt Richter
On Tue, 22 Mar 2005 03:42:05 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: [...] >A fan of Monty and all was Guido, >which inluenced much of what he'd do. ... Oy. Re-reading => DAPR (Day After Posting Remorse) ;-/ Oh well. Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-l

Re: XML/RPC server with SSL in Python

2005-03-22 Thread news
Gerson Kurz wrote: > Are there any alternatives to using M2Crypto for an XML/RPC server in > SSL in Python? tlslite supports SocketServers like SimpleXMLRPCServer: http://trevp.net/tlslite Trevor -- http://mail.python.org/mailman/listinfo/python-list

Anonymus functions revisited : tuple actions

2005-03-22 Thread Kay Schluehr
Hi all, thanks for Your attention ! I think my proposal was more in mind of Rons modified exec than Pythons lambda. When George proposed his unpacking behavoir for list-comps as a pack of suggar: 1. [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)] I interpreted it in a subsequent posting in lambda

Re: Python 2.4 | 7.3 The for statement

2005-03-22 Thread brainsucker
>Still, this can be acomplished with the break statement, in a more >clear way, with less variables (which implies less work for the gc and >everybody). Glad to read from you Francisco. :) Keep up that hard work, thanks. I have been talking with those Python programmers (And Role players), :) and

Re: Building Time Based Bins

2005-03-22 Thread MCD
Michael Spencer wrote: > (BTW, there must be more to your code than you have shared for the above line to > execute without raising an exception - where are 'time' and 'a' initially bound? > BTW2, 'time' is the name of a stdlib module, so it's bad practice to use it as > an identifier) Yes there

Re: multi-threaded list update

2005-03-22 Thread Peter Hansen
Mike Rovner wrote: Hello, Please advise on multi-threaded list *append*: import time, random, thread aList = [] def main(): for i in range(10): thread.start_new_thread(updater, (i,)) time.sleep(30) print aList def updater(n): global aList time.sleep( random.randint(1,n+1) ) aList.ap

Re: Python limericks (was Re: Text-to-speech)

2005-03-22 Thread Peter Hansen
Michael Spencer wrote: How about a category for executable limericks? Here's one to get the ball rolling: # voice only the alphanumeric tokens from itertools import repeat for feet in [3,3,2,2,3]: print " ".join("DA-DA-DUM" for dummy in [None] for foot in repeat("metric", feet)) Brilliant!

Re: typo in the library reference?

2005-03-22 Thread Peter Hansen
Scott David Daniels wrote: nicke wrote: If it really is like this it is uncoherent and quite stupid :P Name-calling won't make anyone more likely to help you out. This is a _collective_ effort. You spotted a problem; submit at least a bug report if not a fix. To be fair, Scott, I think he was say

Re: .pth files?

2005-03-22 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm unclear on how .pth files work. Some posts imply they can be arbitrarily named, as long as they include the .pth extension, and can exist anywhere in the current sys.path. Other documentation seems to imply that they must be named .pth, although I'm not sure what "pac

Re: Anonymus functions revisited

2005-03-22 Thread elbertlev
Please do not change the syntax. Better focus on the library. 1. There are already 3 constructs right now for this problem. 2. List comprehensions are used mostly in examples. At least I came to such conclusion reading the standard library modules. -- http://mail.python.org/mailman/listinfo/pyth

Re: Please help for Python programming

2005-03-22 Thread M.E.Farmer
Hello again, For some strange reason Google isn't showing this so I got this from gmane sorry if I missed something. The fixed/proportional link is located on the google groups c.l.py pages. I wasn't clear at all sorry for the ambiguity. Google groups for c.l.py seems to be fixed by default, so no

Re: Re: problems with  character

2005-03-22 Thread Bengt Richter
On Tue, 22 Mar 2005 20:09:55 -0600, "John Roth" <[EMAIL PROTECTED]> wrote: >I had this problem recently. It turned out that something >had encoded a unicode string into utf-8. When I found >the culprit and fixed the underlying design issue, it went away. > >John Roth > > > >"jdonnell" <[EMAIL PROT

Re: Getting the word to conventional programmers

2005-03-22 Thread Peter Hansen
Jeff Schwab wrote: Peter Maas wrote: Peter Hansen schrieb: Cameron Laird wrote: *DevSource* profiles "The State of the Scripting Universe" in http://www.devsource.com/article2/0,1759,1778141,00.asp >. Which, sadly, doesn't seem to work with Firefox here, though IE shows it fine. :-( Mozilla 1.7.3 s

Re: Python-list Digest, Vol 18, Issue 349

2005-03-22 Thread Srinivasan K
Regards, KSrinivasan Disclaimer: This e-mail is bound by the terms and conditions described at http://www.subexsystems.com/mail-disclaimer.htm - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Tuesday, March 22, 2005 7:11 PM Subject: Python-list Digest, Vol 18, Issue 349 > Sen

Re: Read from the last line of a file?

2005-03-22 Thread Mike Rovner
Anthony Liu wrote: I am wondering if it is possible to start reading from the last line of file, and then the last but one up to the first line. If you can afford to keep the whole file in memory, than: lines = open(..).readlines() print lines[::-1] Otherwise you can use seek() to random-access fil

Re: Anonymus functions revisited

2005-03-22 Thread Ron
On Tue, 22 Mar 2005 21:45:42 +0100, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Ron a écrit : >> On 21 Mar 2005 22:37:42 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> >> wrote: >> >> >>>Mappings like that: >>> >>> ((x,y),z) -> x+y-z >>> >>> ((x,y=0),z) -> None >>> >>>should be valid actions

multi-threaded list update

2005-03-22 Thread Mike Rovner
Hello, Please advise on multi-threaded list *append*: import time, random, thread aList = [] def main(): for i in range(10): thread.start_new_thread(updater, (i,)) time.sleep(30) print aList def updater(n): global aList time.sleep( random.randint(1,n+1) ) aList.append(n) if __name__

Read from the last line of a file?

2005-03-22 Thread Anthony Liu
Normally when we do line = in_file_obj.readline() we read from the first line of a file. I am wondering if it is possible to start reading from the last line of file, and then the last but one up to the first line. __ Do You Yahoo!? Tired of spa

ebXML and Python

2005-03-22 Thread [EMAIL PROTECTED]
Hi, I am looking for advice on implementing ebXML messaging(ebMS) in Python. Any input? (www.ebxml.org). Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to python from URL

2005-03-22 Thread David M. Cooke
Casey Bralla <[EMAIL PROTECTED]> writes: > I've got a python cgi-bin application which produces an apache web page. I > want to pass arguments to it on the URL line, but the parameters are not > getting passed along to python properly. > > I've been using sys.argv to pick up command line argument

Re: comparison puzzle? bug?

2005-03-22 Thread Mike Rovner
Charles Hixson wrote: I hesitate to call this a bug, as at my level of expertise that seems ... unlikely. But I can't think of any other explanation: Call it 'typo' ;) print"item[0] > lvl = %d > %d = " %(item[0], lvl), bool(item[0] == lvl) use bool(item[0] > lvl) HTH, Mike -- http://mail.py

Re: Anonymus functions revisited

2005-03-22 Thread Ron
On Tue, 22 Mar 2005 18:15:25 -0500, "George Sakkis" <[EMAIL PROTECTED]> wrote: >"Ron" <[EMAIL PROTECTED]> wrote: >> On Tue, 22 Mar 2005 21:56:57 GMT, Ron <[EMAIL PROTECTED]> wrote: >> >> >Why should a function not create a local varable of an argument if the >> >varable doesn't exist and a default

Re: problems with  character

2005-03-22 Thread John Roth
I had this problem recently. It turned out that something had encoded a unicode string into utf-8. When I found the culprit and fixed the underlying design issue, it went away. John Roth "jdonnell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a mysql database with characters

Re: how to use structured markup tools

2005-03-22 Thread Uche Ogbuji
On Sat, 2005-03-19 at 00:14 -0800, Sean McIlroy wrote: > I'm dealing with XML files in which there are lots of tags of the > following form: xy (all of these letters are being > used as 'metalinguistic variables') Not all of the tags in the file are > of that form, but that's the only type of tag

Passing arguments to python from URL

2005-03-22 Thread Casey Bralla
I've got a python cgi-bin application which produces an apache web page. I want to pass arguments to it on the URL line, but the parameters are not getting passed along to python properly. I've been using sys.argv to pick up command line arguments, and it works fine when I call the python program

Re: Simple XML-to-Python conversion

2005-03-22 Thread Uche Ogbuji
On Fri, 2005-03-18 at 11:04 -0800, [EMAIL PROTECTED] wrote: > Since I've exhausted every option except for Amara, I've decided to > give it a try. However, this will only work if I can compile Amara and > 4suite along with my application. I doubt 4suite will be able to be > compiled, but I'll try

Re: Simple XML-to-Python conversion

2005-03-22 Thread Uche Ogbuji
On Sat, 2005-03-19 at 15:38 -0800, [EMAIL PROTECTED] wrote: > Thanks Lutz! > > I should have looked into Amara's binderytools module earlier. This is > just the type of tool I was looking for. When I tried testing its > compatibility with py2exe, I was _almost_ able to compile... Does > anyone

Regular Expressions

2005-03-22 Thread Ron
This is probably a repeated question, but try as I might I was unable to find something similar in the archives. I'm trying to develop a regular expression for recognizing a simplified C-Style string syntax. I need it to be able to handle escape sequences of the form \x where x is any character i

Re: SAX parsing problem

2005-03-22 Thread Uche Ogbuji
On Wed, 2005-03-16 at 00:14 -0800, gh wrote: > The characters handler routine is fired 3 times for a > single text block. Why does it do this? Is there a way to prevent > doing this? Continuing in the vein of closing matters cross-posted to XML-SIG: http://mail.python.org/pipermail/xml-sig/200

Re: Python limericks (was Re: Text-to-speech)

2005-03-22 Thread Michael Spencer
How about a category for executable limericks? Here's one to get the ball rolling: # voice only the alphanumeric tokens from itertools import repeat for feet in [3,3,2,2,3]: print " ".join("DA-DA-DUM" for dummy in [None] for foot in repeat("metric", feet)) Michael P.S. I know 'three' doesn

Re: SAX: Help on processing qualified attribute values

2005-03-22 Thread Uche Ogbuji
On Thu, 2005-03-10 at 15:22 +0100, Markus Doering wrote: > Hey, > > I am trying to process XML schema documents using namespace aware SAX > handlers. Currently I am using the default python 2.3 parser: > > parser = xml.sax.make_parser() > parser.setFeature(xml.sax.handler.feature_namespaces, 1)

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Timothy Smith wrote: >>> hi there i need to set my locale so that when i output a number it's >>> formatted with thousands grouped. [â] >> >> import locale >> locale >> locale.setlocale(LC_ALL, '') >> locale.format('%.2f', 100, True) >> >>The `True` turns on grouping

Re: simultaneous copy to multiple media

2005-03-22 Thread TZOTZIOY
On Sun, 20 Mar 2005 22:06:03 +0100, rumours say that Rolf Zwart <[EMAIL PROTECTED]> might have written: >On Unixes I know, only 1 process is needed: >/dev/null >It does work! Of course it does. Why wouldn't it? Or are you referring to the fact that redirection can appear anywhere on the command

Re: comparison puzzle? bug?

2005-03-22 Thread Stephen Thorne
On Tue, 22 Mar 2005 16:32:47 -0800, Charles Hixson <[EMAIL PROTECTED]> wrote: > I hesitate to call this a bug, as at my level of expertise that seems > ... unlikely. But I can't think of any other explanation: > > This is an extract from some longer code: > print"item = ", item > print

Re: Why tuple with one item is no tuple

2005-03-22 Thread TZOTZIOY
On 15 Mar 2005 11:25:15 -0500, rumours say that [EMAIL PROTECTED] (Roy Smith) might have written: >The big question is, is it the parens that make it a tuple, or is it >the comma? If you go along with the parens school of thought, then >(1,) is the special case. If you believe in commas, then th

Re: Pre-PEP: Dictionary accumulator methods

2005-03-22 Thread TZOTZIOY
On Sat, 19 Mar 2005 01:24:57 GMT, rumours say that "Raymond Hettinger" <[EMAIL PROTECTED]> might have written: >I would like to get everyone's thoughts on two new dictionary methods: > >def count(self, value, qty=1): >try: >self[key] += qty >except K

comparison puzzle? bug?

2005-03-22 Thread Charles Hixson
I hesitate to call this a bug, as at my level of expertise that seems ... unlikely. But I can't think of any other explanation: This is an extract from some longer code: print"item = ", item print"item[0] < lvl = %d < %d = " %(item[0], lvl), bool(item[0] < lvl) print"item[0] == lv

Re: cross platform use of set locale

2005-03-22 Thread Timothy Smith
Marc 'BlackJack' Rintsch wrote: In <[EMAIL PROTECTED]>, Timothy Smith wrote: hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for locales, even between uni

Re: problems with  character

2005-03-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jdonnell wrote: > I have a mysql database with characters like à à àin it. I'm > trying to write a python script to remove these, but I'm having a > really hard time. > > [...] > > The other odd thing is that the à character shows up as two spaces if > I print it to th

Re: (noob alert) why doesn't this work?

2005-03-22 Thread Stephen Thorne
On Tue, 22 Mar 2005 12:10:50 +0100, Bouke Woudstra <[EMAIL PROTECTED]> wrote: > for flac in flacfiles: > cmd = 'metaflac --export-tags=- "%s"' % flac > for line in os.popen(cmd).readlines(): > if 'Artist

Re: Python RegExp

2005-03-22 Thread D H
[EMAIL PROTECTED] wrote: I have a string which I wish to match using RE, however when I run my comparison (using the match method) on my machine it never returns, using the CPU fully. In your case it may be simpler to just split the string into groups. You don't even need regular expressions or a

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Timothy Smith wrote: > hi there i need to set my locale so that when i output a number it's > formatted with thousands grouped. the problem i've found is there > doesn't seem to be very good cross platform support for locales, even > between unix's it's horrid. Have you

Re: (noob alert) why doesn't this work?

2005-03-22 Thread Bengt Richter
On Tue, 22 Mar 2005 09:21:49 -0800, Scott David Daniels <[EMAIL PROTECTED]> wrote: >Bouke Woudstra wrote: >> It turned out that some flac files have tags like Artist=artistname and >> others >> have artist=artistname. Therefore it couldn't find the artist! So now I just >> look for 'rtist=' wh

Re: Python RegExp

2005-03-22 Thread David Chipping
Jeff, Thanks very much for that, I didn't even consider the option of it finishing, considering I'm using a much slower machine it was running for over 2 minutes when I just killed it! I think I get the rest now. Cheers again, -David On Tue, 22 Mar 2005 17:52:22 -0600, Jeff Epler <[EMAIL PROTE

Re: C pointers/Python

2005-03-22 Thread Stephen Thorne
On 21 Mar 2005 19:32:20 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can i do something like this? > > if code == CODE1: > data = 0x0 > While True: > len = len - 1 > if len == -1: > break > buffer = data > > Do i need to initialze the buffe

Re: Python RegExp

2005-03-22 Thread Jeff Epler
On my machine the program finishes in 30 seconds. (it's a 1.5GHz machine) If the 'parm' group is removed, or if the buffer is shortened, the time is reduced considerably. There are "pathological cases" for regular expressions which can take quite a long time. In the case of your expression, it's

Re: problems with  character

2005-03-22 Thread Do Re Mi chel La Si Do
And this run OK for me : s = 'a  aaa' print s print s.replace('Â', '') -- http://mail.python.org/mailman/listinfo/python-list

cross platform use of set locale

2005-03-22 Thread Timothy Smith
hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for locales, even between unix's it's horrid. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python RegExp

2005-03-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >I have a string which I wish to match using RE, however when I run my > comparison (using the match method) on my machine it never returns, > using the CPU fully. > > The code is (very simply): > > -- > import re > > buffer = r"#1 1 550 111 SYN

Re: Anonymus functions revisited

2005-03-22 Thread George Sakkis
"Ron" <[EMAIL PROTECTED]> wrote: > On Tue, 22 Mar 2005 21:56:57 GMT, Ron <[EMAIL PROTECTED]> wrote: > > >Why should a function not create a local varable of an argument if the > >varable doesn't exist and a default value is given? > > ok... thought it out better. :) > > Getting a default into a fun

Re: Getting the word to conventional programmers

2005-03-22 Thread jfj
Terry Reedy wrote: "Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] *DevSource* profiles "The State of the Scripting Universe" in http://www.devsource.com/article2/0,1759,1778141,00.asp >. Interesting quote from Guido: "If the same effort were poured into speeding up

RE: sorting a dictionary?

2005-03-22 Thread Tony Meyer
> mydict = {'the':358, 'they':29, 'went':7, 'said':65} > > Is there an easy to sort this dictionary and get a > list like the following (in decreasing order)? > > the 358 > said 65 > they 29 > went 7 The dictionary's keys and values are lists, which can be sorted, so you can just use that.

RE: sorting a dictionary?

2005-03-22 Thread Tony Meyer
> Thank you scott, but 'sorted' itself is not a python > library function. So I assume by > "sorted(mydict.items()", you meant the object of > mydict.items() which has been sorted, right? It's a builtin as of Python 2.4: Python 2.4.1c1 (#63, Mar 10 2005, 10:36:41) [MSC v.1310 32 bit (Intel)] on

Re: C type buffer copy

2005-03-22 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > What's the best way to deal with this in python? I can't tell what you're trying to do. If you want an array containing the numbers 0,1,...,n-1, just say buf = range(n) -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-22 Thread bearophileHUGS
R.H.: > The setdefault() method would continue to exist but > would likely not make it into Py3.0. I agee to remove the setdefault. I like the new count method, but I don't like the appendlist method, because I think it's too much specilized. I too use sets a lot; recently I've suggested to add

Re: C type buffer copy

2005-03-22 Thread Neil Hodgson
Joe: > testCode(unsigned char buf, unsigned long len) > { > unsigned long data=0x0; > while (len--) > { > *buf++ = (unsigned char)data++ This C code will crash since buf is declared as an unsigned char, not an unsigned char*. Stop thinking in terms of translating low level

Re: Anonymus functions revisited

2005-03-22 Thread Ron
On Tue, 22 Mar 2005 21:56:57 GMT, Ron <[EMAIL PROTECTED]> wrote: >Why should a function not create a local varable of an argument if the >varable doesn't exist and a default value is given? ok... thought it out better. :) Getting a default into a function isn't the problem. Returning the value t

Re: Lowest hassle Python web server?

2005-03-22 Thread kanzen
Okay, thanks for your suggestions. Are there any further recommendations as to what Python framework to use if the web server is Apache with mod_python? -- http://mail.python.org/mailman/listinfo/python-list

Python RegExp

2005-03-22 Thread davidchipping
I have a string which I wish to match using RE, however when I run my comparison (using the match method) on my machine it never returns, using the CPU fully. The code is (very simply): -- import re buffer = r"#1 1 550 111 SYNC_PEER RES syncpeers=(id=54325432;add=10."

Re: problems with  character

2005-03-22 Thread Do Re Mi chel La Si Do
a  aaa' 0123456 It's OK -- http://mail.python.org/mailman/listinfo/python-list

Re: typo in the library reference?

2005-03-22 Thread Scott David Daniels
nicke wrote: Note how the U:s and S:s are switched compared to signed and unsigned, this should surely not be like this? Sounds like an opportunity for you to submit a documentation bug report. If it really is like this it is uncoherent and quite stupid :P Name-calling won't make anyone more likely

Re: Anonymus functions revisited

2005-03-22 Thread Ron
On Tue, 22 Mar 2005 21:43:48 +0100, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Ron a écrit : >(snip) def dfv( arg = value): >> >> return arg > > > >>> def dfv( arg = value): >... return arg >... >Traceback (most recent call last): > File "", line 1, in ? >NameError: na

Re: generating audio signals

2005-03-22 Thread nicke
On Tue, 22 Mar 2005 00:51:57 GMT [EMAIL PROTECTED] (Bengt Richter) wrote: > On 21 Mar 2005 11:12:38 -0800, "Cappy2112" <[EMAIL PROTECTED]> wrote: > > >>>Maybe make yourself a little utility first that will show you the > >specs for any .wav file (i.e., > >>>sampling frequency, bytes per sample, c

Re: FW: Python help group

2005-03-22 Thread Gabriel Cooper
I would recommend looking into sorting like objects with the __getitem__ method. http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/b2d0580792b94a7/a707054ec3302a6e has a lively discussion on this topic. Search google for "__getitem__" and "sort" for more information.

Re: beeping portably

2005-03-22 Thread nicke
On Mon, 21 Mar 2005 10:13:36 GMT [EMAIL PROTECTED] (Bengt Richter) wrote: > On 20 Mar 2005 09:03:25 -0800, "Jim" <[EMAIL PROTECTED]> wrote: > > >Hello, > > > >I'd like to emit beeps. The twists are that (1) I hope to have control > >over the frequency of the beeps and their duration and (2) I'd

Re: possible bug?

2005-03-22 Thread Jeff Epler
On Tue, Mar 22, 2005 at 02:19:52PM -0700, Earl Eiland wrote: > Well, your program ran successfully. Perhaps WinRK is not well > behaved. How can a process terminate in such a way that poll() can read > it, but wait() won't? I don't have any idea. Both are implemented in terms of win32event.Wait

Re: getting text from WinXP console

2005-03-22 Thread Mark T.
"Chris Maloof" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > Does anyone know how I can read the ASCII text from a console window > (from another application) in WinXP? It doesn't sound like a major > operation, but although I can find the window via pywin32, I haven't

Re: possible bug?

2005-03-22 Thread Earl Eiland
Well, your program ran successfully. Perhaps WinRK is not well behaved. How can a process terminate in such a way that poll() can read it, but wait() won't? Earl On Tue, 2005-03-22 at 13:49, Jeff Epler wrote: > hm, I guess SIGALRM doesn't exist on Windows. You can run the program > without th

typo in the library reference?

2005-03-22 Thread nicke
from http://docs.python.org/lib/ossaudio-device-objects.html: AFMT_U8 Unsigned, 8-bit audio AFMT_S16_LE Unsigned, 16-bit audio, little-endian byte order (as used by Intel processors) AFMT_S16_BE Unsigned, 16-bit audio, big-endian byte order (as used

(",) Do You Want To Know For Sure You Are Going To Heaven?

2005-03-22 Thread Ron038551
http://www.want-to-be-sure.blogspot.com << Click On Link -- http://mail.python.org/mailman/listinfo/python-list

wanted: visual report templating system

2005-03-22 Thread robin
I am looking for a client/server reporting tool to use with a web application built in Python. It would consist of three parts: 1. a data definition & retrieval engine that interfaces to RDBMS or other data files 2. a visual designer in which a nontechnical person can create a report layout tem

Httplib request method

2005-03-22 Thread knguyen
Hi, For some reason, httplib request() method splits the request packet into two packets, the first packet contains only HTTP headers, the body in the second packet. The first packet size is way below the MTU size. Is there a way I can send everything in one packet? Below is a piece of my code: s

Re: Getting the word to conventional programmers

2005-03-22 Thread Terry Reedy
"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > *DevSource* profiles "The State of the Scripting Universe" in > http://www.devsource.com/article2/0,1759,1778141,00.asp >. Interesting quote from Guido: "If the same effort were poured into speeding up Python as Sun d

MinGW building with Python 2.4

2005-03-22 Thread mrstephengross
Ok, I know there are already a million posts on this group about getting Python to build with MinGW. I've been through many of them, and have still not found a good comprehensive way to accomplish this. I've got Cygwin 5.1 with GCC 3.3.3 on it. I'm using Python 2.4. Note: You invoke the mingwin c

Re: possible bug?

2005-03-22 Thread Jeff Epler
hm, I guess SIGALRM doesn't exist on Windows. You can run the program without the 'signal.signal' line or the 'signal.alarm' line, and you'll be stuck with a hung Python if subprocess.Popen exhibits the bug. Jeff pgp80TDX5i7qo.pgp Description: PGP signature -- http://mail.python.org/mailman/li

Re: Submission for Python Limmerick Contest

2005-03-22 Thread Raseliarison nirinA
> A tuple, a dict, and a list, > And whitespace which mus'n't be missed. > Imported together, > And stirred with a feather, > Yields a language whose name must be hissed! A char, an integer and a float, And a decimal which precision is fixed Computerised altogether Then shaked down with a mixer As

Re: problems with  character

2005-03-22 Thread Claudio Grondi
"Claudio Grondi" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > >>s = 'a  aaa' > >>What am I doing wrong? > > First get rid of characters not allowed > in Python code. > Replace  with appropriate escape > sequence: /x## where ## is the (should be \x##) > hexadecimal cod

Re: Anonymus functions revisited

2005-03-22 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : (snip) You are right, but for lambda in its current limited form short, named functions are a good replacement. -inf on this !-) -- http://mail.python.org/mailman/listinfo/python-list

How to use subprocess

2005-03-22 Thread Nicolas Fleury
Hi, I want to use the subprocess module (or any standard Python module) to run a process: - which stdout and stderr can each be redirected to any file-like object (no fileno function). - can be cancelled with a threading.Event. My problem is that the subprocess.Popen constructor doesn't seem to

Re: Anonymus functions revisited

2005-03-22 Thread Bruno Desthuilliers
Ron a écrit : On 21 Mar 2005 22:37:42 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: Mappings like that: ((x,y),z) -> x+y-z ((x,y=0),z) -> None should be valid actions too. What is the audience thinking about that? I think that there's too much implied, and that in the long run it, if we k

Re: Anonymus functions revisited

2005-03-22 Thread Bruno Desthuilliers
Ron a écrit : (snip) def dfv( arg = value): return arg > >>> def dfv( arg = value): ... return arg ... Traceback (most recent call last): File "", line 1, in ? NameError: name 'value' is not defined And sorry, but -1 for using exec here. -- http://mail.python.org/mailman/listinfo

Re: problems with  character

2005-03-22 Thread Claudio Grondi
>>s = 'a  aaa' >>What am I doing wrong? First get rid of characters not allowed in Python code. Replace  with appropriate escape sequence: /x## where ## is the hexadecimal code of the ASCII character. Claudio -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with  character

2005-03-22 Thread deelan
jdonnell wrote: I have a mysql database with characters like   » in it. I'm trying to write a python script to remove these, but I'm having a really hard time. use the "hammer" recipe. i'm using it to create URL-friendly fragment from latin-1 album titles:

Re: XML/RPC server with SSL in Python

2005-03-22 Thread Paul Rubin
[EMAIL PROTECTED] (Gerson Kurz) writes: > Are there any alternatives to using M2Crypto for an XML/RPC server in > SSL in Python? stunnel? (www.stunnel.org) -- http://mail.python.org/mailman/listinfo/python-list

Re: Confirm: compiled re(gexps) are thread safe?

2005-03-22 Thread Johan Ovlinger
Skip Montanaro wrote: Johan> Subject says it all, really. Yes, searching using a compiled regular expression is thread-safe. Skip Great. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: possible bug?

2005-03-22 Thread Earl Eiland
I'm running ActivePython PythonWin 2.4, and get the error message"'AributeError: 'module' object has no attribute 'SIGALRM'". The example provided in the ActivePython documents use signal.SIGALRM, so I'm not sure what's going on... Earl On Tue, 2005-03-22 at 12:43, Jeff Epler wrote: > I wrote a

Re: C pointers/Python

2005-03-22 Thread Lonnie Princehouse
"len" is a built-in function in Python, so you probably don't want to use it as a variable name. What is this C code actually trying to do? Don't try to transliterate it; instead, read up on how lists and slicing work, and rewrite it in Python starting from a higher level of abstraction. One hin

Re: Python becoming less Lisp-like

2005-03-22 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > And does this code object know which non-local names are on an > intermediate level and which are global? Yes (from 2.2): >>> import dis >>> x = 1 >>> def f(): ... y = 2 ... def g(): ...z = 3 ...print x,y,z

Re: UTF Questions

2005-03-22 Thread Serge Orlov
Fuzzyman wrote: > Thanks Serge. You're welcome. While we at it, iconvcodec supports utf-32 and more. I have sent a 2.4 windows build of iconvcodec module to the author. He promised to publish it soon. Serge. -- http://mail.python.org/mailman/listinfo/python-list

problems with  character

2005-03-22 Thread jdonnell
I have a mysql database with characters like   » in it. I'm trying to write a python script to remove these, but I'm having a really hard time. These strings are coming out as type 'str' not 'unicode' so I tried to just record[4].replace('Â', '') but this does nothing. However the followin

  1   2   >