Re: Why less emphasis on private data?

2007-01-07 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Just how often do you inherit from two identically-named classes > both of which use identically-named private attributes? I have no idea how often if ever. I inherit from library classes all the time, without trying to examine what superclasses they

Re: Module to read svg

2007-01-07 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > Does anyone know if there's an actual free implementation of this? For the dom module in it, xml.dom.minidom should work. Depending on your processing needs, that might be sufficient. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-07 Thread Steven D'Aprano
On Sun, 07 Jan 2007 19:30:05 -0800, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> > If you want to write bug-free code, pessimism is the name of the game. >> >> I wonder whether Paul uses snow chains all year round, even in the blazing >> summer? After all, "if you want to dr

Re: Recommendations (or best practices) to define functions (or methods)

2007-01-07 Thread Martin v. Löwis
vizcayno schrieb: > Need your help in the "correct" definition of the next function. If > necessary, I would like to know about a web site or documentation that > tells me about best practices in defining functions, especially for > those that consider the error exceptions management. I agree with

Re: regex question

2007-01-07 Thread Paul McGuire
"proctor" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > hello, > > i hope this is the correct place... > > i have an issue with some regex code i wonder if you have any insight: > > There's nothing actually *wrong* wth your regex. The problem is your misun

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread W. Watson
Gabriel Genellina wrote: > On 7 ene, 16:20, "W. Watson" <[EMAIL PROTECTED]> wrote: > >> We seem to be looping. I have the Python interpreter. I would like the >> pythonwin editor. The download link doesn't work on SourceForge. Where can I >> get it? If not there, where? If it can't be obtained, th

multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-07 Thread Ray Schumacher
The class seems to work pretty well - very basic and fast, it just serves images from the specified port and camera device (USB cam). I added an ImageServer class and some code to __main__ class ImageServer(RequestHandler): def __init__(self, conn, addr, server): asynchat.async_chat.

regex question

2007-01-07 Thread proctor
hello, i hope this is the correct place... i have an issue with some regex code i wonder if you have any insight: import re, sys def makeRE(w): print w + " length = " + str(len(w)) reString = "r'" + w[:1] w = w[1:] if len(w) > 0:

Re: how to find the longst element list of lists

2007-01-07 Thread Steven Bethard
Scott David Daniels wrote: > Dan Sommers wrote: >> ... >> longest_list, longest_length = list_of_lists[ 0 ], len( >> longest_list ) >> for a_list in list_of_lists[ 1 : ]: >> a_length = len( a_list ) >> if a_length > longest_length: >> longest_list, longest_lengt

Re: Recommendations (or best practices) to define functions (or methods)

2007-01-07 Thread George Sakkis
vizcayno wrote: > Hello: > Need your help in the "correct" definition of the next function. If > necessary, I would like to know about a web site or documentation that > tells me about best practices in defining functions, especially for > those that consider the error exceptions management. > I h

Re: how to find the longst element list of lists

2007-01-07 Thread Scott David Daniels
Dan Sommers wrote: > ... > longest_list, longest_length = list_of_lists[ 0 ], len( longest_list ) > for a_list in list_of_lists[ 1 : ]: > a_length = len( a_list ) > if a_length > longest_length: > longest_list, longest_length = a_list, a_length > will run faster

Re: Why less emphasis on private data?

2007-01-07 Thread Paul Rubin
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > I'd be quite concerned about the design environment rather than the > immediate code... Probably need something ugly like... > > from mod1 import B as B1 > from mod2 import B as B2 > class A(B1, B2): > Interesting. I just tried that. mo

Re: Why less emphasis on private data?

2007-01-07 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > If you want to write bug-free code, pessimism is the name of the game. > > I wonder whether Paul uses snow chains all year round, even in the blazing > summer? After all, "if you want to drive safely, pessimism is the name of > the game". No. I'm w

Re: Why less emphasis on private data?

2007-01-07 Thread Paul Rubin
"Paul Boddie" <[EMAIL PROTECTED]> writes: > > Consider that the above three class definitions might be in separate > > files and you see how clumsy this gets. > > What are you trying to show with the above? The principal benefit of > using private attributes set on either the class or the instance

Module to read svg

2007-01-07 Thread [EMAIL PROTECTED]
I'm looking for a module to load an SVG document so that I can read out its contents in some graphics-centric way. For example, path elements store their vertices in a long attribute string you need to parse. An ideal module would get me these vertices in a list. SVGdraw seems to only write, but n

Re: C++/Python programmers for a MUD's gamedriver wanted.

2007-01-07 Thread [EMAIL PROTECTED]
Paul McGuire wrote: > Have you considered whether the C++ Driver is even necessary? Python's > run-time engine already implements the memory and process management tasks, > and does so in compiled C code (and has been tested and retested by > hundreds, nay thousands, perhaps even millions of Pyth

Re: how to find the longst element list of lists

2007-01-07 Thread Dan Sommers
On Sun, 07 Jan 2007 22:23:22 +0100, "Michael M." <[EMAIL PROTECTED]> wrote: > How to find the longst element list of lists? > I think, there should be an easier way then this: > s1 = ["q", "e", "d"] > s2 = ["a", "b"] > s3 = ["a", "b", "c", "d"] [ snip ] One more thing to think about: if

Recommendations (or best practices) to define functions (or methods)

2007-01-07 Thread vizcayno
Hello: Need your help in the "correct" definition of the next function. If necessary, I would like to know about a web site or documentation that tells me about best practices in defining functions, especially for those that consider the error exceptions management. I have the next alternatives but

Re: Working with Excel inside Python

2007-01-07 Thread John Machin
[EMAIL PROTECTED] wrote: > Or, you might want to look at two packages: > > xlrd > > pyExcelerator > > The first can "read" .xls files, and the second can write them. I've had > great results with both. > Hi Gerry, Thanks for the testimonial for xlrd :-) However I don't understand how a reasonab

Table

2007-01-07 Thread [EMAIL PROTECTED]
Hello Someone know how do I get the collunm's number of a gkt.Table ? -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-07 Thread Martin v. Löwis
Stef Mientki schrieb: > Can this be achieved without redundancy ? You can use the registry design to use the object's name also to find the object. In the most simple way, this is registry = {} class pin: def __init__(self, name): registry[name] = self self.name = name pin('aap') prin

lxml namespaces problem

2007-01-07 Thread Maxim Sloyko
Hi All! I have a little problem with XML namespaces. In my application I have two XML processors, that process the same document, one after the other. The first one looks for nodes in 'ns1' namespace, and substitutes them, according to some algorithm. After this processor is finished, it is guara

Re: how to find the longst element list of lists

2007-01-07 Thread Michael M.
Sorry, wrong place. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find the longst element list of lists

2007-01-07 Thread Michael M.
Bruno Desthuilliers wrote: > > Err... this makes three distinct lists, not a list of lists. > Sure. Logically spoken. Not in Python code. Or a number of lists. Sure not [[ bla... ] [bla.]] etc. -- http://mail.python.org/mailman/listinfo/python-list

Additional pyparsing examples in latest release (1.4.5)

2007-01-07 Thread Paul McGuire
It seems I left out some examples from my announcement of pyparsing 1.4.5. Here is a more complete list of the new examples: parsePythonValue.py - parses strings representing lists, dicts, and tuples, with nesting support; safe alternative to using eval sql2dot.py - SQL diagram generator, parsed

Re: Working with Excel inside Python

2007-01-07 Thread gblais
Or, you might want to look at two packages: xlrd pyExcelerator The first can "read" .xls files, and the second can write them. I've had great results with both. Gerry -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-07 Thread Carl Banks
Martin Miller wrote: > Carl Banks wrote: > > > Martin Miller wrote: > > > ### non-redundant example ### > > > import sys > > > > > > class Pin: > > > def __init__(self, name, namespace=None): > > > self.name = name > > > if namespace == None: > > > # default to call

Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
On 7 ene, 18:52, "Dustan" <[EMAIL PROTECTED]> wrote: > Shouldn't that same page be found on the python > website?http://www.python.org/doc/2.0/ > Any clue as to why it isn't? For 2.0 it's on http://www.python.org/download/releases/2.0/new-python.htm For later ones, it's on http://www.python.org/

Re: Working with Excel inside Python

2007-01-07 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have a .plt file (which is a tab delimited ASCII file) and I want to > format it to get a .dbf with data in rows and columns, detele some > rows/columns and substitute decimal '.' with ','. All this using Python Then you may want to have a look here: http://docs.pyt

Re: Why less emphasis on private data?

2007-01-07 Thread Steven D'Aprano
On Sun, 07 Jan 2007 04:09:13 -0800, Paul Rubin wrote: > "Felipe Almeida Lessa" <[EMAIL PROTECTED]> writes: >> What is the chance of having to inherit from two classes from >> different modules but with exactly the same name *and* the same >> instance variable name? >> >> Of course you're being ve

Re: how to find the longst element list of lists

2007-01-07 Thread Thomas Ploch
Michael M. schrieb: >> Err... this makes three distinct lists, not a list of lists. >> > > Sure. Logically spoken. Not in Python code. Or a number of lists. > Sure not [[ bla... ] [bla.]] etc. ??? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: where is python on linux?

2007-01-07 Thread rzed
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Frank Potter a écrit : >> I installed fedora core 6 and it has python installed. >> But the question is, where is the executable python file? >> I can't find it so I come here for help. > > man which > > mmm... slo

Re: how to find the longst element list of lists

2007-01-07 Thread Michael M.
> > Err... this makes three distinct lists, not a list of lists. > Sure. Logically spoken. Not in Python code. Or a number of lists. Sure not [[ bla... ] [bla.]] etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: PDF rendering toolkit?

2007-01-07 Thread Martin Miller
Jorge Vargas wrote: > Hi > > I'm looking for a tool to take an actual .pdf file and display it in a > window (I'm using wxwidgets at the moment) > > [snip] How about just using Adobe's Acrobat Reader application which is freely available on most platforms? There's some related information about d

Re: [OT] (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-07 Thread Bruno Desthuilliers
Martin Miller a écrit : > Bruno Desthuilliers wrote: > >>Martin Miller a écrit : >>(snip) >> >>>Oh, contrair. >> >>I guess you mean "au contraire" ?-) >> >>(snip) > > > FWIW "contrair" is how it's spelled in the Oxford English dictionary (I > actually did look it up before posting because it see

Re: strange for loop construct

2007-01-07 Thread Dustan
Mark Elston wrote: > * Gabriel Genellina wrote (on 1/5/2007 12:49 PM): > > At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote: > > > >> wordfreq = [wordlist.count(p) for p in wordlist] > >> > >> I would expect > >> > >> for p in wordlist: > >> wordfreq.append(wordlist.count(p)) > >> > >> > >> I

Re: how to find the longst element list of lists

2007-01-07 Thread Bruno Desthuilliers
Michael M. a écrit : > How to find the longst element list of lists? For what definition of "find" ? You want the lenght of the longest sublist, it's index, or a reference to it ? > I think, there should be an easier way then this: > > s1 = ["q", "e", "d"] > s2 = ["a", "b"] > s3 = ["a", "

Re: how to find the longst element list of lists

2007-01-07 Thread Jussi Salmela
Michael M. kirjoitti: > How to find the longst element list of lists? > > I think, there should be an easier way then this: > > s1 = ["q", "e", "d"] > s2 = ["a", "b"] > s3 = ["a", "b", "c", "d"] > > > > After, the list ist sorted: > > sx1 = ["a", "b", "c", "d"] > sx2 = ["q", "e", "d

Re: strange for loop construct

2007-01-07 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Gabriel> Where do you find the "What's new" for previous releases? I > Gabriel> have to read them online. > >> > >> Google for > >> > what's new site:python.org > > Sorry, I took "I have to read them online" to mean that you needed to read > the

Working with Excel inside Python

2007-01-07 Thread AleydisGP
I have a .plt file (which is a tab delimited ASCII file) and I want to format it to get a .dbf with data in rows and columns, detele some rows/columns and substitute decimal '.' with ','. All this using Python (I'm using Pythonwin). The .plt file looks like this: * ISCST3 (02035): Tersa * MODELIN

how to find the longst element list of lists

2007-01-07 Thread Michael M.
How to find the longst element list of lists? I think, there should be an easier way then this: s1 = ["q", "e", "d"] s2 = ["a", "b"] s3 = ["a", "b", "c", "d"] if len(s1) >= len(s2) and len(s1) >= len(s3): sx1=s1 ## s1 ist längster if len(s2) >= len(s3): sx2=s2

Re: Why less emphasis on private data?

2007-01-07 Thread Bruno Desthuilliers
John Nagle a écrit : > sturlamolden wrote: > >> [EMAIL PROTECTED] wrote: >> >>> Coming from a C++ / C# background, the lack of emphasis on private data >>> seems weird to me. I've often found wrapping private data useful to >>> prevent bugs and enforce error checking.. >>> >>> It appears to me (pe

Re: Python cheatsheets

2007-01-07 Thread robert
gonzlobo wrote: > Curious if anyone has a python cheatsheet* published? I'm looking for > something that summarizes all commands/functions/attributes. Having > these printed on a 8" x 11" double-sided laminated paper is pretty > cool. > > * cheatsheet probably isn't the right word, but you get th

Re: how to find the longst element list of lists

2007-01-07 Thread Thomas Ploch
Michael M. schrieb: > How to find the longst element list of lists? > > I think, there should be an easier way then this: > >s1 = ["q", "e", "d"] >s2 = ["a", "b"] >s3 = ["a", "b", "c", "d"] > >if len(s1) >= len(s2) and len(s1) >= len(s3): > sx1=s1 ## s1 ist längster >

Re: how to find the longst element list of lists

2007-01-07 Thread Felipe Almeida Lessa
On 1/7/07, Michael M. <[EMAIL PROTECTED]> wrote: > How to find the longst element list of lists? s1 = ["q", "e", "d"] s2 = ["a", "b"] s3 = ["a", "b", "c", "d"] s = [s1, s2, s3] s.sort(key=len, reverse=True) print s[0] is s3 print s[1] is s1 print s[2] is s2 sx1, sx2, sx3 = s print 'sx1:', sx1 pr

Re: AES256 in PyCrypto

2007-01-07 Thread mirandacascade
Sebastian 'lunar' Wiesner wrote: > Since you are apparently unable to read to docstrings of this module, I > will give you a short hint: yes, pycrypto supports AES with 256 bit > keys. Thank you for the information. The material I consulted was: a) the PyCrypto manual: http://www.amk.ca/python/wr

Re: Python cheatsheets

2007-01-07 Thread Martin Miller
gonzlobo wrote: > Curious if anyone has a python cheatsheet* published? I'm looking for > something that summarizes all commands/functions/attributes. Having > these printed on a 8" x 11" double-sided laminated paper is pretty > cool. > > * cheatsheet probably isn't the right word, but you get th

Re: Python cheatsheets

2007-01-07 Thread Jussi Salmela
gonzlobo kirjoitti: > Curious if anyone has a python cheatsheet* published? I'm looking for > something that summarizes all commands/functions/attributes. Having > these printed on a 8" x 11" double-sided laminated paper is pretty > cool. > > * cheatsheet probably isn't the right word, but you ge

Re: Re:[OT] (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-07 Thread Martin Miller
Bruno Desthuilliers wrote: > Martin Miller a écrit : > (snip) > > > > Oh, contrair. > > I guess you mean "au contraire" ?-) > > (snip) FWIW "contrair" is how it's spelled in the Oxford English dictionary (I actually did look it up before posting because it seemed like there ought be an 'e' on the

Python cheatsheets

2007-01-07 Thread gonzlobo
Curious if anyone has a python cheatsheet* published? I'm looking for something that summarizes all commands/functions/attributes. Having these printed on a 8" x 11" double-sided laminated paper is pretty cool. * cheatsheet probably isn't the right word, but you get the idea. :) -- http://mail.p

audio video streaming communications

2007-01-07 Thread Ken Seehart
Hello, I am looking for a good audio/video conferencing library. Ideally it should work with wxPython (or have some means of making it work there). So far my main difficulty in my attempt at searching for such a package is that there is so much stuff out there on downloading music and videos.

Re: Capturing stderr and stdout of a subprocess as a single stream

2007-01-07 Thread Gabriel Genellina
On 7 ene, 17:37, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > Two threads and a queue sounds horrible. But unfortunately it's the only way if you don't control how the child process behaves. (It's not s ugly afterwards... certainly would be worse if you had to syncronize both reading threads and t

Re: Why less emphasis on private data?

2007-01-07 Thread Bruno Desthuilliers
Andrea Griffini a écrit : > Bruno Desthuilliers wrote: > > >> ... and on > >>> the opposite I didn't expect that fighting with object >>> leaking in complex python applications was that difficult >>> (I've heard of zope applications that just gave up and >>> resorted to the "reboot every now and

Re: Capturing stderr and stdout of a subprocess as a single stream

2007-01-07 Thread Fuzzyman
Gabriel Genellina wrote: > On 7 ene, 16:33, "Fuzzyman" <[EMAIL PROTECTED]> wrote: [snip..] > > My current code works, but *doesn't* capture stderr : > > > > from threading import Thread > > > > pipe = os.popen(executable) > > > > def DisplayOutput(): > > while True: > > output = pipe.r

Re: Why less emphasis on private data?

2007-01-07 Thread Gabriel Genellina
On 7 ene, 16:13, John Nagle <[EMAIL PROTECTED]> wrote: > Because Python doesn't have explicit declarations, scope of variables is > a touchy issue. If you write "x = 1" within a function, that will > create a local "x" if "x" doesn't exist, or alter a global "x" if "x" was > previously creat

Re: OpenBSD, Apache and Python

2007-01-07 Thread Martin v. Löwis
Geoff schrieb: > I'm now looking at using fastcgi to run my python. This looks like it's > going to work fine, though I will be using a fcgi interface such as > http://jonpy.sourceforge.net/. There does not seem to be any official > fastcgi module for python. > > Should I be worried about the stab

Re: where is python on linux?

2007-01-07 Thread Bruno Desthuilliers
Frank Potter a écrit : > I installed fedora core 6 and it has python installed. > But the question is, where is the executable python file? > I can't find it so I come here for help. man which -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-07 Thread Bruno Desthuilliers
Thomas Ploch a écrit : > sturlamolden schrieb: (snip) > >>As mentioned in other replies, it is not rocket science to access a >>class private data. In C++ you can cast to void*, in Java and C# you >>can use reflection. C++ is said to be an "unsafe" language because >>programmers can, using a few t

Re: Capturing stderr and stdout of a subprocess as a single stream

2007-01-07 Thread Gabriel Genellina
On 7 ene, 16:33, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > Hello all, > > Before I ask the question a couple of notes : > > * This question is for implementing a script inside the Wing IDE. For > some reason using the subprocess module doesn't work so I need a > solution that doesn't use this modul

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread Jussi Salmela
W. Watson kirjoitti: > Gabriel Genellina wrote: >> On 7 ene, 13:22, "W. Watson" <[EMAIL PROTECTED]> wrote: >> >> https://sourceforge.net/projects/pywin32/ >> >>> As I understand it, there are two files I'm after: 1. python >>> interpreter, >>> and 2. a python editor. It's #2 that I'm having tr

Re: strange for loop construct

2007-01-07 Thread skip
Gabriel> Where do you find the "What's new" for previous releases? I Gabriel> have to read them online. >> >> Google for >> > what's new site:python.org Sorry, I took "I have to read them online" to mean that you needed to read them online because (perhaps) you don't have

Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
On 7 ene, 16:34, [EMAIL PROTECTED] wrote: > Gabriel> Where do you find the "What's new" for previous releases? I > Gabriel> have to read them online. > > Google for > > what's new site:python.org That's what I do. But this post: > If you have a Python installation you should be able

Re: Python re expr from Perl to Python

2007-01-07 Thread Thomas Ploch
Florian Diesch schrieb: > "Michael M." <[EMAIL PROTECTED]> wrote: > >> In Perl, it was: >> >> >> ## Example: "Abc | def | ghi | jkl" >> ## -> "Abc ghi jkl" >> ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st >> pipe). >> $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; >> >>

Re: Traceback of hanged process

2007-01-07 Thread Gabriel Genellina
On 6 ene, 19:45, Hynek Hanke <[EMAIL PROTECTED]> wrote: > please, how do I create a pythonic traceback from a python process that > hangs and is not running in an interpreter that I executed manually > or it is but doesn't react on CTRL-C etc? I'm trying to debug a server > implemented in Python,

Re: strange for loop construct

2007-01-07 Thread skip
Gabriel> Where do you find the "What's new" for previous releases? I Gabriel> have to read them online. Google for what's new site:python.org Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-07 Thread Andrea Griffini
Bruno Desthuilliers wrote: >> ... and on >> the opposite I didn't expect that fighting with object >> leaking in complex python applications was that difficult >> (I've heard of zope applications that just gave up and >> resorted to the "reboot every now and then" solution). >> > Zope is a specia

Capturing stderr and stdout of a subprocess as a single stream

2007-01-07 Thread Fuzzyman
Hello all, Before I ask the question a couple of notes : * This question is for implementing a script inside the Wing IDE. For some reason using the subprocess module doesn't work so I need a solution that doesn't use this module. * The platform is Windows and I'm happy with a Windoze only soluti

Re: urlib.quote gives KeyError in Python 2.4.4 but workin 2.3.5

2007-01-07 Thread Duncan Booth
"nyenyec" <[EMAIL PROTECTED]> wrote: > but it seems to work in Python 2.3.5 > > Python 2.3.5 (#1, Aug 19 2006, 21:31:42) > [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin > Type "help", "copyright", "credits" or "license" for more information. import sys, urllib print sys.versio

Re: Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-07 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > Is there a Pythonic way to read the file and identify any illegal XML > characters so I can strip them out? this would keep my program more > flexible - if the vendor is going to allow one illegal character in > their document, there's no way of knowing if another one w

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread Gabriel Genellina
On 7 ene, 16:20, "W. Watson" <[EMAIL PROTECTED]> wrote: > We seem to be looping. I have the Python interpreter. I would like the > pythonwin editor. The download link doesn't work on SourceForge. Where can I > get it? If not there, where? If it can't be obtained, then I'll go to the > default edit

Re: urlib.quote gives KeyError in Python 2.4.4 but workin 2.3.5

2007-01-07 Thread Gabriel Genellina
On 7 ene, 15:48, "nyenyec" <[EMAIL PROTECTED]> wrote: > urllib.quote chokes on unicode in 2.4.4. >>> urllib.quote(u"\xe9") > KeyError: u'\xe9' > > but it seems to work in Python 2.3.5 > > Is this a known bug? See some recent posts about "urllib.unquote and unicode" -- Gabriel Genellina -- htt

Re: Python re expr from Perl to Python

2007-01-07 Thread Florian Diesch
"Michael M." <[EMAIL PROTECTED]> wrote: > In Perl, it was: > > > ## Example: "Abc | def | ghi | jkl" > ## -> "Abc ghi jkl" > ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st > pipe). > $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; > > ## -- remove [ and ] in text > $n

Re: urlib.quote gives KeyError in Python 2.4.4 but workin 2.3.5

2007-01-07 Thread nyenyec
encode seems to solve my problem: >>> urllib.quote(u'\xe9'.encode('utf-8')) '%C3%A9' Cheers, nyenyec nyenyec wrote: > urllib.quote chokes on unicode in 2.4.4. > > >>> print sys.version > 2.4.4 (#1, Oct 18 2006, 10:34:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] > >>> urllib.quote(u"\xe9")

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread W. Watson
Gabriel Genellina wrote: > On 7 ene, 13:22, "W. Watson" <[EMAIL PROTECTED]> wrote: > > https://sourceforge.net/projects/pywin32/ > >> As I understand it, there are two files I'm after: 1. python interpreter, >> and 2. a python editor. It's #2 that I'm having trouble downloading. The >> link i

OpenBSD, Apache and Python

2007-01-07 Thread Geoff
Hi! I'm wanting to use openbsd to run a webserver because of its high security. The website is written in python. Before I was using linux with apache 2 and mod_python and this worked well. My problem is that mod_python 3.x does not work on apache 1 which is what comes with openbsd (and has been h

Re: A problem in embedding Python in a plug-in

2007-01-07 Thread Gabriel Genellina
On 6 ene, 15:29, Koichi <[EMAIL PROTECTED]> wrote: > Hi, I'm now making a plug-in for a CG software. I embed > Python in a plugin and it works. The problem is that it > conflicts with other plugins that also embeds Python because it > runs in the same thread. I don't know when Py_Initialize() and

Re: find a .py path

2007-01-07 Thread Gabriel Genellina
On 5 ene, 13:33, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Be aware with this. It is different when you do > > /usr/bin/python prog.py > > and > > ./prog.py > > In the first case, sys.argv[0] will be /usr/bin/python! No, sys.argv[0] is always the running script, and sys.argv[1] the first argument

urlib.quote gives KeyError in Python 2.4.4 but workin 2.3.5

2007-01-07 Thread nyenyec
urllib.quote chokes on unicode in 2.4.4. >>> print sys.version 2.4.4 (#1, Oct 18 2006, 10:34:39) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] >>> urllib.quote(u"\xe9") Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2

Re: Why less emphasis on private data?

2007-01-07 Thread John Nagle
sturlamolden wrote: > [EMAIL PROTECTED] wrote: > >>Coming from a C++ / C# background, the lack of emphasis on private data >>seems weird to me. I've often found wrapping private data useful to >>prevent bugs and enforce error checking.. >> >>It appears to me (perhaps wrongly) that Python prefers t

Re: Recommended way to force a thread context switch?

2007-01-07 Thread Gabriel Genellina
On 6 ene, 20:01, Lloyd Zusman <[EMAIL PROTECTED]> wrote: > It seems that the original writer of the app had set this interval to a > high value in a part of the code that I overlooked until you mentioned > this right now. > > [...] once one of the big > number-crunching threads gets control, it st

Re: Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-07 Thread scott
Thanks, I'll work with the file on the file system, then parse it with SAX. Is there a Pythonic way to read the file and identify any illegal XML characters so I can strip them out? this would keep my program more flexible - if the vendor is going to allow one illegal character in their document,

Re: Why less emphasis on private data?

2007-01-07 Thread Thomas Ploch
Sebastian 'lunar' Wiesner schrieb: > > Those people deserve to fail for being just extraordinary stupid... > Yes, but there are a lot of them around... Thomas P.S.: I don't mean they are around here. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread Gabriel Genellina
On 7 ene, 13:22, "W. Watson" <[EMAIL PROTECTED]> wrote: > >>>https://sourceforge.net/projects/pywin32/ > As I understand it, there are two files I'm after: 1. python interpreter, > and 2. a python editor. It's #2 that I'm having trouble downloading. The > link is broken. The above link should wo

Re: Why less emphasis on private data?

2007-01-07 Thread Sebastian 'lunar' Wiesner
[ Thomas Ploch <[EMAIL PROTECTED]> ] > sturlamolden schrieb: >> [EMAIL PROTECTED] wrote: >>> Coming from a C++ / C# background, the lack of emphasis on private >>> data seems weird to me. I've often found wrapping private data >>> useful to prevent bugs and enforce error checking.. >>> >>> It appe

Re: AES256 in PyCrypto

2007-01-07 Thread Sebastian 'lunar' Wiesner
[ [EMAIL PROTECTED] <[EMAIL PROTECTED]> ] > > Marc 'BlackJack' Rintsch wrote: > >> `a` must be of length 32 for AES256. And the length of `plainText` >> must be a multiple of 16 because it's a block cypher algorithm. > > Thank you. I have some follow up questions and 1 tangential question. >

Re: strange for loop construct

2007-01-07 Thread Gabriel Genellina
Mark Elston ha escrito: > If you have a Python installation you should be able to find the > "Whats New" section of the docs. List comprehensions are described > pretty well in the "What's new in Python 2.0?" section. This gives > some simple examples as well as the rationale behind them. Where

Re: still struggling, howto use a list-element as a name ? Sory, hit send button to early

2007-01-07 Thread Gabriel Genellina
Stef Mientki ha escrito: > class LED (device): > pinlist ={ > # pinname type init-value other-parameters > 1: ('Cathode', _DIG_IN, [], _par2), > 2: ('Anode', _DIG_OUT, [], _par33) > } > > Status = {True:('On'), False:('Off')} >

Re: Why less emphasis on private data?

2007-01-07 Thread Bruno Desthuilliers
Paul Rubin a écrit : > "Felipe Almeida Lessa" <[EMAIL PROTECTED]> writes: > >>What is the chance of having to inherit from two classes from >>different modules but with exactly the same name *and* the same >>instance variable name? >> >>Of course you're being very pessimistic or extremely unlucky.

Re: Why less emphasis on private data?

2007-01-07 Thread Bruno Desthuilliers
Andrea Griffini a écrit : > Paul Rubin wrote: > > > Yes I've had plenty of > >> pointer related bugs in C programs that don't happen in GC'd >> languages, so GC in that sense saves my ass all the time. > > > My experience is different, I never suffered a lot for > leaking or dangling pointers

Re: low level python read's

2007-01-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, gz wrote: > So how do i stop python from trying to be smart and just read *at most* > 1000 chars and let it go if he(it?*) reads less? For low level file stuff use the functions in the `os` module, i.e. `os.read()`. > p.s *is python a "he" or an "it"? I'd say "it". Ciao

Re:[OT] (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-07 Thread Bruno Desthuilliers
Martin Miller a écrit : (snip) > > Oh, contrair. I guess you mean "au contraire" ?-) (snip) -- http://mail.python.org/mailman/listinfo/python-list

Re: c# application calling Scipy

2007-01-07 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Hi, > > Novice here. :) > > I'm building a c# application and I want to call functions in SciPy > from that application. > > What's the best way to call SciPy methods from a C# program? You need to: 1. Embed a Python interpreter in your C# app. That is, importing from

Re: Why less emphasis on private data?

2007-01-07 Thread Thomas Ploch
sturlamolden schrieb: > [EMAIL PROTECTED] wrote: >> Coming from a C++ / C# background, the lack of emphasis on private data >> seems weird to me. I've often found wrapping private data useful to >> prevent bugs and enforce error checking.. >> >> It appears to me (perhaps wrongly) that Python prefer

Re: Why less emphasis on private data?

2007-01-07 Thread Paul Boddie
Paul Rubin wrote: > > class A: > __x = 3 > > class B(A): > __x = 4 # ok > > class C(B): > __x = 5 # oops! > > Consider that the above three class definitions might be in separate > files and you see how clumsy this gets. What are you trying to show with the above?

Re: where is python on linux?

2007-01-07 Thread jim-on-linux
on linux type: whereis python You should get a list of directories where all of python lives. jim-on-linux http:\\www.inqvista.com On Sunday 07 January 2007 04:05, Frank Potter wrote: > I installed fedora core 6 and it has python > installed. But the question is, where is the > executable

Re: I want to learn

2007-01-07 Thread joeyslistings
Thanks for the links guys!! Dive into Python is great and I am subscribing to tutor as well. Thomas Ploch wrote: > [EMAIL PROTECTED] schrieb: > > Hi, > > > > I have been "programming" in the .net environment and ide for a few > > years and I am looking to make the switch over to python. I have >

Re: Why less emphasis on private data?

2007-01-07 Thread sturlamolden
[EMAIL PROTECTED] wrote: > Coming from a C++ / C# background, the lack of emphasis on private data > seems weird to me. I've often found wrapping private data useful to > prevent bugs and enforce error checking.. > > It appears to me (perhaps wrongly) that Python prefers to leave class > data publ

Re: How to invoke parent's method?

2007-01-07 Thread Peter Decker
On 7 Jan 2007 01:33:32 -0800, Frank Millman <[EMAIL PROTECTED]> wrote: > The essential point is that you save a reference to the frame when you > create the panel. Then when the button is clicked you can use the > reference to call the frame's Close method. Or you could look into Dabo. This is on

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread Thomas Ploch
W. Watson schrieb: > As I understand it, there are two files I'm after: 1. python interpreter, > and 2. a python editor. It's #2 that I'm having trouble downloading. The > link is broken. This is the python interpreter for windows: http://www.python.org/ftp/python/2.5/python-2.5.msi Here you

Re: Just Getting Started with Python on MS XP Pro

2007-01-07 Thread W. Watson
Jussi Salmela wrote: > W. Watson kirjoitti: >> Thomas Ploch wrote: > > >>> https://sourceforge.net/projects/pywin32/ >>> >>> I think this is the place to go >>> >>> Thomas >>> >>> >> That gets me the python program (pywin), which I got from a URL in a >> post above (python-win.msi). I guess thes

  1   2   >