Re: UTF Questions

2005-03-22 Thread Fuzzyman
Thanks Serge. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread Claudio Grondi
For me, one of the reasons for using Python is the ease and the intuivity of reading its code. I have a problem with intuitively getting what is going on when using a pattern like (x,y,z=0) -> (x,y,z) where I expect at the first glance some C code with access to class members. At least I must st

Re: Save passwords in scripts

2005-03-22 Thread Serge Orlov
Florian Lindner wrote: > Paul Rubin wrote: > >> - sort of similar: have a separate process running that knows the >> password (administrator enters it at startup time). That process >> listens on a unix socket and checks the ID of the client. It reveals >> the password to authorized clients, i.e.

Re: Please help for Python programming

2005-03-22 Thread bruno modulix
[EMAIL PROTECTED] wrote: (snip) The PRINT code is for my testing. My problem is bytemsg will be omitted some records. For example, my text file have 53 records about username. After byteDict = users1[user1], Which, from your previous snippet, should raise a KeyError... If it does, then first unde

Re: Begniner Question

2005-03-22 Thread bruno modulix
Glen wrote: #!/usr/local/bin/python import sys print "1.\tDo Something" print "2.\tDo Something" print "3.\tDo Something" print "4.\tDo Something" print "5.\tDo Something" print "6.\tExit" choice=raw_input("Please Enter Choice: ") if int(choice)==1: print "Here" else: pass if int(choice)==2:

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
Claudio Grondi wrote: For me, one of the reasons for using Python is the ease and the intuivity of reading its code. I guess this is true for many of us. Now 'ease and intuitivity' stronly depends on one's background... I have a problem with intuitively getting what is going on when using a patt

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
Kay Schluehr wrote: Since George Sakkis proposed a new way of doing list comprehensions http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ac5023ad18b2835f/d3ff1b81fa70c8a7#d3ff1b81fa70c8a7 letting tuples-like objects (x,y,z=0) acting as functions on other tuples I wonder why th

Re: Anonymus functions revisited

2005-03-22 Thread Antoon Pardon
Op 2005-03-22, Claudio Grondi schreef <[EMAIL PROTECTED]>: > For me, one of the reasons for using Python > is the ease and the intuivity of reading its > code. > I have a problem with intuitively getting > what is going on when using a pattern like > (x,y,z=0) -> (x,y,z) > where I expect at the

Using default a empty dictionary as a default value

2005-03-22 Thread C Gillespie
Dear All, I ran my code through pylint to clean it up and one of the (many) errors it through up was Dangerous default value {} as argument Bascially, I have: class NewClass: def __init__(self, myDict={}): for key, value in myDict: print key, value Obviously, this is not

Re: Using default a empty dictionary as a default value

2005-03-22 Thread Diez B. Roggisch
C Gillespie wrote: > Dear All, > I ran my code through pylint to clean it up and one of the (many) errors > it through up was > Dangerous default value {} as argument > Bascially, I have: > > class NewClass: > def __init__(self, myDict={}): > for key, value in myDict: > p

Re: Using default a empty dictionary as a default value

2005-03-22 Thread SER.RI-TIC-Alexis Roda
C Gillespie wrote: Dear All, I ran my code through pylint to clean it up and one of the (many) errors it through up was Dangerous default value {} as argument Bascially, I have: class NewClass: def __init__(self, myDict={}): for key, value in myDict: print key, value Obviou

(noob alert) why doesn't this work?

2005-03-22 Thread Bouke Woudstra
Hi, I'm a bit stuck with this python script. It's aim is to encode all flac files to wav and then to mp3. The only problem I have is to preserve the tags. The code works when there's just one flac file in a directory but fails for more. I can't see why the for loop fails here (flactags). The

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

2005-03-22 Thread Simon Brunning
On Tue, 22 Mar 2005 12:10:50 +0100, Bouke Woudstra <[EMAIL PROTECTED]> wrote: > Hi, > > I'm a bit stuck with this python script. It's aim is to encode all flac files > to wav and then to mp3. The only problem I have is to preserve the tags. The > code works when there's just one flac file in a dir

Re: Anonymus functions revisited

2005-03-22 Thread Claudio Grondi
> > Why not: > > try: > > (x,y,z) > > except NameError: > > z=0 > > (x,y,z) > > ? instead of > > lambda x,y,z=0:(x,y,z) > Because it does not do the same thing ?-) Haven't got the idea why? () > Because, if it did, it would still require 5 times more lines of code to > do the same thing (he

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

2005-03-22 Thread Diez B. Roggisch
> > The error thrown is: UnboundLocalError: local variable 'title' referenced > before assignment That should be pretty obvious: The UnboundLocalError comes up when you try to access a variable that hasn't been assigned a value before. E.g try this in an interactive python session: foo = "hello"

Re: Constructor class problem

2005-03-22 Thread Joal Heagney
Diez B. Roggisch wrote: Wolfgang wrote: Hi, I am a newbie and have to modify some python moduls. I get the followin error: TypeError: __init__() takes exactly 3 arguments (2 given) Here the code snippet: class gXconv: def __init__(self, pathValue): self.pathValue=pathValue self.__

Re: Anonymus functions revisited

2005-03-22 Thread Claudio Grondi
> > Already > > lambda x,y,z=0:(x,y,z) > > is a problem for me. > > > > Why not: > > try: > > (x,y,z) > > except NameError: > > z=0 > > (x,y,z) > > ? > > Because they are not equivallent. > > > Watching the last piece of code > > can even directly be seen, that there > > is eventually a Nam

Getting the word to conventional programmers

2005-03-22 Thread Cameron Laird
*DevSource* profiles "The State of the Scripting Universe" in http://www.devsource.com/article2/0,1759,1778141,00.asp >. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using default a empty dictionary as a default value

2005-03-22 Thread Peter Hansen
C Gillespie wrote: Dear All, I ran my code through pylint to clean it up and one of the (many) errors it through up was Dangerous default value {} as argument Bascially, I have: class NewClass: def __init__(self, myDict={}): for key, value in myDict: print key, value Obviou

Re: Getting the word to conventional programmers

2005-03-22 Thread Peter Hansen
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. :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-22 Thread Antoon Pardon
Op 2005-03-21, Jeff Shannon schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-03-18, Jeff Shannon schreef <[EMAIL PROTECTED]>: >> >> I find it odd that you start by saying you still find them very >> consistent and here state there is a slight inconsistency. > > I said that the way th

[ANN] Dabo 0.3.2 Released

2005-03-22 Thread Ed Leafe
Just in time for PyCon DC 2005, we'd like to announce the release of Dabo 0.3.2. A summary of what's changed since the last release can be found at http://dabodev.com/announcements/changeLog-0.3.2. Source code is available for download at http://dabodev.com/download. ___/ / __/ /

Re: Getting the word to conventional programmers

2005-03-22 Thread Peter Maas
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 shows it fine, too. FF bug or config

Re: Getting the word to conventional programmers

2005-03-22 Thread Jeff Schwab
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 shows it fine, too

Re: Python becoming less Lisp-like

2005-03-22 Thread Steve Holden
Antoon Pardon wrote: Op 2005-03-21, Jeff Shannon schreef <[EMAIL PROTECTED]>: Antoon Pardon wrote: Op 2005-03-18, Jeff Shannon schreef <[EMAIL PROTECTED]>: I find it odd that you start by saying you still find them very consistent and here state there is a slight inconsistency. I said that the way

Re: xmlrpc with Python and large datases

2005-03-22 Thread Steve Holden
writeson wrote: Duncan, Thanks for the reply. We are running this on an Apache server on the linux box, and an iPlanet4.1 server on the solaris machines. However, both these servers are strictly 'inside' the firewall. I checked the apache configuration and there is no limitrequestbody parameter in

Re: Anonymus functions revisited

2005-03-22 Thread Antoon Pardon
Op 2005-03-22, Claudio Grondi schreef <[EMAIL PROTECTED]>: > reducing the number of lines to two, > but I don't, because in my eyes > I can read the code better if > spread over five lines and because > of this, the code becomes in my > opinion even less error-prone. > Actually I would write in my

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

2005-03-22 Thread Bouke Woudstra
Thanks for all suggestions. Your first point I knew, but was too lazy to type it. It made no difference for the test files had all tags. Knowing that it was not a asynchrous thing helped me a lot though. There had to be something wrong with the command line for metaflac. It turned out that som

Re: Pre-PEP: Dictionary accumulator methods

2005-03-22 Thread Steve Holden
Greg Ewing wrote: Michele Simionato wrote: def defaultdict(defaultfactory, dictclass=dict): class defdict(dictclass): def __getitem__(self, key): try: return super(defdict, self).__getitem__(key) except KeyError: return self.setdef

Re: xmlrpc with Python and large datases

2005-03-22 Thread Fredrik Lundh
Steve Holden wrote: > Usually a "broken pipe" message is to do with disruption of a Unix pipeline > rather than a network > connection. I've seen the message mostly, IIRC, in BSD-based environments. the socket layer uses EPIPE to indicate that a socket has been shut down by the remote end.

Doubt regarding exec function

2005-03-22 Thread Mosas
Dear All, Php has exec function to run system commands and this function return last line of system command result. But in Python I can see only os.system() function to run system command but it doesn't return any result like php exec function. I want to know about php equivalent exec fu

Re: Please help for Python programming

2005-03-22 Thread M.E.Farmer
Terry, This was posted from google groups, can you see the indents? # code snippet convertpage = 0 form = None for o, a in opts: if o in ["-h", "--help"]: Usage() sys.exit() if o in ["-o", "--output", "--out"]: output = a if o

Re: Anonymus functions revisited

2005-03-22 Thread Ron
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 w

Re: Python becoming less Lisp-like

2005-03-22 Thread Antoon Pardon
Op 2005-03-22, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-03-21, Jeff Shannon schreef <[EMAIL PROTECTED]>: >> >>>Antoon Pardon wrote: >>> Op 2005-03-18, Jeff Shannon schreef <[EMAIL PROTECTED]>: I find it odd that you start by saying you still find the

Re: Doubt regarding exec function

2005-03-22 Thread Diez B. Roggisch
Mosas wrote: > Dear All, > Php has exec function to run system commands and > this function return last line of system command > result. But in Python I can see only os.system() > function to run system command but it doesn't return > any result like php exec function. > I want to know

regarding ignore case sensitive of a string using regular expressions

2005-03-22 Thread Mosas
Dear All In Perl when we are checking some conditions using regular expression we can ignore the case sensitive of a string using the following regular expression /(^[^a-z])|/|(\.\.)/i. But If I try to do this in Python I couldn't get any result. So Any body know regarding this

PythonWin (build 203) for Python 2.3 causes Windows 2000 to grind to a halt?

2005-03-22 Thread Mohammad.Ayyash
Hi, I am having the same problem and wondering if anyone was able to fix it? or provide an alternative to ActiveState pythonwin     -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread Diez B. Roggisch
> letting tuples-like objects (x,y,z=0) acting as functions on other > tuples I wonder why this would not be a good starting point of > rethinking anonymus functions? > > In Georges proposition the action is > >(x,y,z=0) -> (x,y,z) > > i.e. mapping tuples on other tuples. This is equivalent

Re: regarding ignore case sensitive of a string using regular expressions

2005-03-22 Thread Maarten Sneep
Mosas wrote: > In Perl when we are checking some conditions > using regular expression we can ignore the case > sensitive of a string using the following regular > expression /(^[^a-z])|/|(\.\.)/i. > But If I try to do this in Python I couldn't get > any result. > So Any body k

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
bruno modulix wrote: Kay Schluehr wrote: Since George Sakkis proposed a new way of doing list comprehensions http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ac5023ad18b2835f/d3ff1b81fa70c8a7#d3ff1b81fa70c8a7 letting tuples-like objects (x,y,z=0) acting as functions on other

possible bug?

2005-03-22 Thread Earl Eiland
I've been having trouble with a program hanging when using the subprocess modules "wait()" method. Replacing it with with a loop that used "poll()" solved the problem. Earl -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 | 7.3 The for statement

2005-03-22 Thread he . dicho . que . no . quiero . spam
brainsucker wrote: > Python 2.4 | 7.3 The for statement: > --- > > for_stmt ::= "for" target_list "in" expression_list ":" > suite ["else" ":" suite] > > > New for statement: > -- > > for_stmt ::= "for" target_list "in" expression_list > [ "and"

Re: Python 2.4 | 7.3 The for statement

2005-03-22 Thread Facundo Batista
On 22 Mar 2005 06:32:38 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The for definition could be like this: > > for_stmt ::= "for" target_list "in" expression_list > [ "until" expression ] ":" > suite ["else" ":" suite] > > or some other word that clarifies the work of t

Re: Anonymus functions revisited

2005-03-22 Thread Claudio Grondi
> for x,y,z in some_iterator: > > If some_iterator produces at some time > a tuple with only two elements this > will raise an exception no matter > whether you assigned z already or not. So if I now understand it right, the core of the whole proposal is to find a way to make unpacking of tuples

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
Claudio Grondi wrote: for x,y,z in some_iterator: If some_iterator produces at some time a tuple with only two elements this will raise an exception no matter whether you assigned z already or not. So if I now understand it right, the core of the whole proposal is to find a way to make unpacking o

Re: compiled open source Windows lisp (was Re: Python becoming less Lisp-like)

2005-03-22 Thread TLOlczyk
On 16 Mar 2005 06:37:45 -0500, Carl Shapiro <[EMAIL PROTECTED]> wrote: >I have a virtually completed port of CMUCL to Win32. And, if I was >not busy organizing a Lisp conference, it would be publicly available >by now. If it's the conference I think, then the deadline for papers was about a week

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
Diez B. Roggisch wrote: letting tuples-like objects (x,y,z=0) acting as functions on other tuples I wonder why this would not be a good starting point of rethinking anonymus functions? In Georges proposition the action is (x,y,z=0) -> (x,y,z) i.e. mapping tuples on other tuples. This is equivalen

Re: missing? dictionary methods

2005-03-22 Thread Bengt Richter
On 22 Mar 2005 07:40:50 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: [...] >I also was under the impression that a particular part of >my program almost doubled in execution time once I replaced >the naive dictionary assignment with these self implemented >methods. A rather heavy burden IMO for so

Best IDE

2005-03-22 Thread tom . russell
If money is not an issue, what are the best options for a "Professional" IDE for Python that includes all the normal stuff PLUS a GUI Builder?? Its an open ended question but I need some opinions from those that have actually used some stuff. This is for a business producing in house programs fo

Submission for Python Limmerick Contest

2005-03-22 Thread haraldarminmassa
My submission for P.L.C. A mathematican named van Rossum went hunting for opossum he could not find one all eaten by Python to her his language he named as a blossum wish me luck Harald -- http://mail.python.org/mailman/listinfo/python-list

Re: possible bug?

2005-03-22 Thread Jeff Epler
On Tue, Mar 22, 2005 at 07:16:11AM -0700, Earl Eiland wrote: > I've been having trouble with a program hanging when using the > subprocess modules "wait()" method. Replacing it with with a loop that > used "poll()" solved the problem. Please include an example, and more information about what pla

Re: Anonymus functions revisited

2005-03-22 Thread Diez B. Roggisch
> Not exactly in fact - unless I messed something. There are 2 problems > here: a more flexible tuple unpacking, *and* a lambda in disguise. > Actually, I'd go + 1 for the first, -1 for the second The proposed syntax from Kay is lambda in disguise. To make it work like George want it is modifying

Re: Submission for Python Limmerick Contest

2005-03-22 Thread Roy Smith
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! -- http://mail.python.org/mailman/listinfo/python-list

Re: pyopengl and py2exe

2005-03-22 Thread woodsman
You excluded them, so they're going to be missing as far as it is concerned. When you copy the OpenGL directory as per the instructions, it should work fine. Does it? -- http://mail.python.org/mailman/listinfo/python-list

[perl-python] sorting matrixes

2005-03-22 Thread Xah Lee
Today we'll write a program that can sort a matrix in all possible ways. Here's the Perl documentation. I'll post a Perl and Python version in 2 days. --- sort_matrix( $matrix, [[$n1, $stringQ, $directionQ], [$n2, $stringQ, $directionQ], ...]) sorts a matrix by $n1 th column then $n2 th.

Re: Anonymus functions revisited

2005-03-22 Thread Ron
On Tue, 22 Mar 2005 15:05:55 +0100, bruno modulix <[EMAIL PROTECTED]> wrote: >bruno modulix wrote: >> Kay Schluehr wrote: >> >>> Since George Sakkis proposed a new way of doing list comprehensions >>> letting tuples-like objects (x,y,z=0) acting as functions on other >>> tuples I wonder why this

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

2005-03-22 Thread Scott David Daniels
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=' which works great. You might want try using something like this: wanted = set('artist album date

The Running Time of +=

2005-03-22 Thread MyHaz
What is the running time of conactination on character strings. i.e. >> joe="123" >> joe+="9" is it Amortized Constant time? I don't think it would be O((number of chars)^2) but i really don't know. Teach me how to fish, where would i find out more about the internal representa

.pth files?

2005-03-22 Thread [EMAIL PROTECTED]
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 "package" it would be named a

Re: Anonymus functions revisited

2005-03-22 Thread Claudio Grondi
> What do you find most readable: your version, with an ad-hoc function > defined somewhere else, far away in the code, or a simpler: > for (x,y,z=0) in tupleList: > do_whatever_with_it() I came up with the "ad-hoc function" to give a kind of replacement for the used syntax, in order not to as

C type buffer copy

2005-03-22 Thread [EMAIL PROTECTED]
Hello, How does Python deal with C type memory buffers. Does Python return everything as an object irrespective of the data type? Here's what i am trying to achieve? testCode(unsigned char buf, unsigned long len) { unsigned long data=0x0; while (len--) { *buf++ = (unsigned ch

Re: Anonymus functions revisited

2005-03-22 Thread bruno modulix
Claudio Grondi wrote: What do you find most readable: your version, with an ad-hoc function defined somewhere else, far away in the code, or a simpler: for (x,y,z=0) in tupleList: do_whatever_with_it() I came up with the "ad-hoc function" to give a kind of replacement for the used syntax, in or

Re: getting text from WinXP console

2005-03-22 Thread Cappy2112
>>Popen(args='c:\\WINDOWS\\system32\\command.com' Don't launch command.com, try running the actual program you are interested in in capturing the text for. Although you should be able to run the command interpreter too- I don't know why that didn't work. There are several variations of popen, so

Re: Submission for Python Limmerick Contest

2005-03-22 Thread Swaroop C H
On 22 Mar 2005 11:44:03 -0500, Roy Smith wrote: > 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! Nice! +1 -- Swaroop C H Blog: http://www.swaroopch.info Book: http://www.byte

Re: Wikipedia - conversion of in SQL database stored data to HTML

2005-03-22 Thread Claudio Grondi
> $main_prefix = "u:/WikiMedia-Static-HTML/"; > $wiki_language = "pl"; > The script is running now for over half an hour > and has created yet 1.555 folders and > generated 527 files with a total size of 6 MBytes > consuming only 16 seconds of CPU time. > I estimate the time until the script i

FW: Python help group

2005-03-22 Thread Leeds, Mark
Can someone help me with below  ? It’s not my question but I will forward any answers to my friend who I am sending this for.   Mark       -Original Message- From: Tan, Heap Ho Sent: Tuesday, March 22, 2005 1:11 PM To: Leeds, Mark Subje

Re: [perl-python] sorting matrixes

2005-03-22 Thread TZOTZIOY
On 22 Mar 2005 09:02:51 -0800, rumours say that "Xah Lee" <[EMAIL PROTECTED]> might have written: >Today we'll write a program that can sort a matrix in all possible >ways. > >Here's the Perl documentation. I'll post a Perl and Python version in 2 >days. Don't bother writing a Python version...

urllib versus IIS

2005-03-22 Thread Shane Hathaway
I started experimenting with SOAPpy yesterday and immediately hit a snag. Both web services I tried simply hung and never replied. After a lot of digging, I found out what was going wrong: urllib.urlopen() is issuing an HTTP/1.0 request, but Microsoft IIS 5 ignores the client HTTP version and

Re: FW: Python help group

2005-03-22 Thread Swaroop C H
On Tue, 22 Mar 2005 13:15:15 -0500, Leeds, Mark wrote: > I want to do a sort on a list of objects based on a similar attributes in > each object for example time of creation of this object. >>> >>> class Student: ... def __init__(self, name, age): ... self

Re: Building Time Based Bins

2005-03-22 Thread MCD
Ok, thanks Michael, I got it sorted out now. It was just a question of placing the append statement and the new list in the right place. I also added a delete command so the list doesn't become too huge, especially when there's no need to keep it. Here's the corrected code: if bintm == :

Re: .pth files?

2005-03-22 Thread Skip Montanaro
Ben> I'm unclear on how .pth files work. Some posts imply they can be Ben> arbitrarily named, as long as they include the .pth extension, and Ben> can exist anywhere in the current sys.path. Other documentation Ben> seems to imply that they must be named .pth, although I'm Be

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

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

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

2005-03-22 Thread Fredrik Lundh
Johan Ovlinger wrote: > Can someone please confirm that I can safely do something like the below, > without needing a thread-local compiled regexp? yes. > global_var = re.compile( "foo" ) > > for str in manystrings: > def domatch(str): >if global_var.search(str): > print "yahooo!" > t

FW: FW: Python help group

2005-03-22 Thread Leeds, Mark
This is a follow up question To the previous question About sorting that I sent for my friend. -Original Message- From: Tan, Heap Ho Sent: Tuesday, March 22, 2005 2:06 PM To: Leeds, Mark Subject: RE: FW: Python help group How can you speed it? Does anyone know if py

Re: possible bug?

2005-03-22 Thread Earl Eiland
I'm running the following code on Windows 2000, 5.00.2195: for x in Files: Command_String = 'C:\Program Files\WinRK\WinRK.exe -create ' + os.path.join(InputDirectory, os.path.splitext(x)[0]) + ' -set compression_method ppmz -setg include_paths none -add ' + os.path.join(InputDirectory, x)

Re: The Running Time of +=

2005-03-22 Thread Skip Montanaro
> "Haz" == MyHaz <[EMAIL PROTECTED]> writes: Haz> Teach me how to fish, where would i find out more about the Haz> internal representations of data types in python The source. Experimentally you can use the timeit command to see how it performs: % for i in 10 20 40 80 160 320 640 1

Re: C type buffer copy

2005-03-22 Thread Ivan Van Laningham
Hi All-- def testCode(data): buf=data[:] # and I hope you're going to do something with buf, # because otherwise this function's a bit of a waste;-) "[EMAIL PROTECTED]" wrote: > > Hello, > > How does Python deal with C type memory buffers. Does Python return > everything as an object i

Re: possible bug?

2005-03-22 Thread Jeff Epler
I wrote a program to use subprocess.Popen 1 times, and never had .wait() hang. If this is a bug, it may be Windows specific. Here's the program I ran: #- import subprocess, signal def timeout(*args): print "Timed out

XML/RPC server with SSL in Python

2005-03-22 Thread Gerson Kurz
Are there any alternatives to using M2Crypto for an XML/RPC server in SSL in Python? Come to think of it, what pythonesque XML/RPC servers do you recommend (you know, beyond SimpleXMLRPCServer.py) -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help for Python programming

2005-03-22 Thread Terry Reedy
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry, > This was posted from google groups, can you see the indents? Yes, looks good > # code snippet >convertpage = 0 >form = None >for o, a in opts: >if o in ["-h", "--help"]: >Usage()

Re: .pth files?

2005-03-22 Thread Ben Beuchler
On Tue, 22 Mar 2005 12:52:28 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > .pth naming is just a convention so you can easily sort out the > association for each of multiple pth files. I have a mojam.pth file but no > "mojam" package on my server. Works just fine. Interesting. Where does

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

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

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: 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: 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: 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: 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: 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: 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: 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: 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

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
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

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: 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: 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

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: 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

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

  1   2   >