Re: regex question

2007-01-08 Thread proctor
Paul McGuire wrote: 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

another SQL implement

2007-01-08 Thread Thinker
RDBMS weak. DBMS is reduced as a indexed storage. Relational algebra is so powerful effective. Why don't integrate it into Python language? Downloads: The implementation depend on pythk, so you need two modules, pysql pythk http://master.branda.to/downloads/pysql/pysql-20070108.tar.gz http

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

2007-01-08 Thread Frank Millman
Martin v. Löwis wrote: 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

Re: regex question

2007-01-08 Thread Steven D'Aprano
On Sun, 07 Jan 2007 23:57:00 -0800, proctor wrote: it does work now...however, one more question: when i type: rx_a = re.compile(r'a|b|c') it works correctly! shouldn't: rx_a = re.compile(makeRE(test)) give the same result since makeRE(test)) returns the string r'a|b|c' Those two

Re: regex question

2007-01-08 Thread proctor
Steven D'Aprano wrote: On Sun, 07 Jan 2007 23:57:00 -0800, proctor wrote: it does work now...however, one more question: when i type: rx_a = re.compile(r'a|b|c') it works correctly! shouldn't: rx_a = re.compile(makeRE(test)) give the same result since makeRE(test)) returns the

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

2007-01-08 Thread Martin v. Löwis
Frank Millman schrieb: If there is something wrong with the SQL statement, I do not want to crash the server, I want to notify the client that there was something wrong, so that the offending module can be corrected and reloaded. Right. In a distributed system, you should propagate the error

Re: regex question

2007-01-08 Thread Mark Peters
is there any way i would be successful then, in using raw string inside my makeRE() function? Why do you think you even need a raw string? Just build and return the string 'a|b|c' (NOTE: DON'T add the quotes to the string) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find the longst element list of lists

2007-01-08 Thread Peter Otten
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_length = a_list,

Re: regex question

2007-01-08 Thread Paul McGuire
proctor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] it does work now...however, one more question: when i type: rx_a = re.compile(r'a|b|c') it works correctly! Do you see the difference between: rx_a = re.compile(r'a|b|c') and rx_a = re.compile(r'a|b|c') There is no

Re: regex question

2007-01-08 Thread proctor
Mark Peters wrote: is there any way i would be successful then, in using raw string inside my makeRE() function? Why do you think you even need a raw string? Just build and return the string 'a|b|c' (NOTE: DON'T add the quotes to the string) yes, i suppose you are right. i can't think

Re: regex question

2007-01-08 Thread proctor
Paul McGuire wrote: proctor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] it does work now...however, one more question: when i type: rx_a = re.compile(r'a|b|c') it works correctly! Do you see the difference between: rx_a = re.compile(r'a|b|c') and rx_a =

Re: regex question

2007-01-08 Thread Mark Peters
yes, i suppose you are right. i can't think of a reason i would NEED a raw string in this situation. It looks from your code that you are trying to remove all occurances of one string from the other. a simple regex way would be to use re.sub() import re a = abc b = debcabbde re.sub([ + a

Re: Just Getting Started with Python on MS XP Pro

2007-01-08 Thread Jussi Salmela
W. Watson kirjoitti: 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

Walking The Right Path

2007-01-08 Thread Tim Daneliuk
Ah yes, moral philosophy and python all come together... Er, that is to day: Imagine you have this situation on a *nix filesystem: Symlink A: /foo - /usr/home Symlink B: /bar - /foo/username If I do this: import os print os.path.realpath(/bar) I get this (as one would expect):

Re: Why less emphasis on private data?

2007-01-08 Thread Paul Boddie
Paul Rubin wrote: Right, the problem is if those methods start changing the private variable. I should have been more explicit about that. class A: def __init__(self): self.__x = 3 def foo(self): return self.__x class B(A): pass class A(B): def bar(self):

Re: Parallel Python

2007-01-08 Thread Laszlo Nagy
[EMAIL PROTECTED] wrote: Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because python interpreter uses GIL(Global Interpreter Lock) for internal

Re: Why less emphasis on private data?

2007-01-08 Thread Paul Rubin
Paul Boddie [EMAIL PROTECTED] writes: Has this ever been reported as a bug in Python? I could imagine more sophisticated name mangling: something to do with the identity of the class might be sufficient, although that would make the tolerated subversive access to private attributes rather

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

2007-01-08 Thread Diez B. Roggisch
vizcayno schrieb: 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

Stackless Python 2.5 for Nintendo DS

2007-01-08 Thread Richard Tew
Hi, I have updated NDS Python from Python 2.4.3 to Python 2.5 (or rather the Stackless version of it). You can read more about it here if it might interest you: http://www.disinterest.org/NDS/Python25.html Cheers, Richard. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get file name on a remote server with ftplib?

2007-01-08 Thread alex
Thanks guys for the help! I used nlst(). The ftputil seems to be very helpfull, but getting a new library in an organization like the one I work at is big issue. Thanks anyway :) [EMAIL PROTECTED] wrote: alex wrote: Hello, My script is trying to get a file from a remote server, every

Re: Walking The Right Path

2007-01-08 Thread Jakub Stolarski
Tim Daneliuk napisal(a): Ah yes, moral philosophy and python all come together... Er, that is to day: Imagine you have this situation on a *nix filesystem: Symlink A: /foo - /usr/home Symlink B: /bar - /foo/username If I do this: import os print os.path.realpath(/bar) I get

Re: how to find the longst element list of lists

2007-01-08 Thread Steven D'Aprano
On Sun, 07 Jan 2007 20:55:19 -0500, Dan Sommers wrote: 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 ]

Re: Parallel Python

2007-01-08 Thread Duncan Booth
Laszlo Nagy [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because python interpreter uses GIL(Global

the free b2b website guide

2007-01-08 Thread haisge
the free b2b website guide http://www.b2bbyte.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-08 Thread Duncan Booth
Paul Boddie [EMAIL PROTECTED] wrote: Paul Rubin wrote: Right, the problem is if those methods start changing the private variable. I should have been more explicit about that. class A: def __init__(self): self.__x = 3 def foo(self): return self.__x class B(A): pass

Re: Why less emphasis on private data?

2007-01-08 Thread Steven D'Aprano
On Sun, 07 Jan 2007 23:49:21 -0800, Paul Rubin wrote: 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. You've established that there's a name

General Question About Python

2007-01-08 Thread Enteng
To those who program in python, what programs do you do? Also what community projects are you involved in(OSS probably)? Will mastering the language land me a job? I'm thinking about learning the language as a hobby. Just curious :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Module to read svg

2007-01-08 Thread Robert Kern
Martin v. Löwis wrote: [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. I don't think it quite fits what the OP is asking for.

Re: where is python on linux?

2007-01-08 Thread Hendrik van Rooyen
rzed [EMAIL PROTECTED] wrote: mmm... sloppy joes -- rzed A sandwich is a sandwich, but a Manwich is a meal. You eat people? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-08 Thread Paul Boddie
Steven D'Aprano wrote: The truth of the matter is, MyClass.__private is not private at all. It is still a public attribute with a slightly unexpected name. In other words, if you want to code defensively, you should simply assume that Python has no private attributes, and code accordingly.

Re: Working with Excel inside Python

2007-01-08 Thread AleydisGP
Sorry for my little knowledge on Python. Actually my knowledge is specific for automating geo-processing tasks within ESRI environment, but sometimes I need to automate some other tasks (like this one) which require more in-depth knowledge of this language. Lots of documentation are of no use when

Proper way of handling plug-in methods

2007-01-08 Thread Franck PEREZ
All, My application deals with strings formatting. I have built-in methods but I also expect the user to add its methods in its own .py files (some sort of plugin methods, all user methods should be exposed in my application). Here is the structure I have thought of : formatting.py

Re: Why less emphasis on private data?

2007-01-08 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: I have no idea how often if ever. You've established that there's a name conflict when you do so, which leads to bugs. So how often do you get bitten by that particular type of bug? I don't know. Likely zero, possibly not. I'm sure I've written

Re: General Question About Python

2007-01-08 Thread Sardaukary
Enteng wrote: To those who program in python, what programs do you do? Also what community projects are you involved in(OSS probably)? Will mastering the language land me a job? I'm thinking about learning the language as a hobby. Just curious :) If you have any programming experience you'll

Re: how to find the longst element list of lists

2007-01-08 Thread Peter Otten
Steven D'Aprano wrote: On Sun, 07 Jan 2007 20:55:19 -0500, Dan Sommers wrote: 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 =

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

2007-01-08 Thread vizcayno
Martin v. Löwis ha escrito: 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

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

2007-01-08 Thread vizcayno
Diez B. Roggisch ha escrito: vizcayno schrieb: 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

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

2007-01-08 Thread vizcayno
Diez B. Roggisch ha escrito: vizcayno schrieb: 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

Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
x = (1.234567890125, 1.2345678901255) print x print x[0], x[1] (1.234567890124, 1.2345678901254999) 1.23456789012 1.23456789013 Is there a rational reason, or is that simply an artifact of the way that the code has evolved? It is clearly not a bug :-) Regards, Nick Maclaren. --

Re: where is python on linux?

2007-01-08 Thread Michael M.
$ whoami cannibal ;-) Hendrik van Rooyen wrote: rzed [EMAIL PROTECTED] wrote: mmm... sloppy joes -- rzed A sandwich is a sandwich, but a Manwich is a meal. You eat people? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Python Papers: Submission Deadline Imminent for Volume 2

2007-01-08 Thread Tennessee Leeuwenburg
Submission Deadline Imminent http://pythonpapers.cgpublisher.com/diary/11 To those who have submitted content for The Python Papers, we salute you. To the rest, we will be accepting zero-hour submissions up until the time of publication. However, the closer the deadline gets, the less likely it

Finding the name of a class

2007-01-08 Thread tim mosher
Hello I'm looking for a Larry Bates that was in the Navy. Could this be you?? In CT in 1965??? In your 60's?? Please let me know I have been searching for over 10 yrs thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Why less emphasis on private data?

2007-01-08 Thread Hendrik van Rooyen
Paul Rubin http://[EMAIL PROTECTED] wrote: If you want to write bug-free code, pessimism is the name of the game. A healthy touch of paranoia does not come amiss either... And even then things foul up in strange ways because your head is never quite literal enough. When you hear a programmer

Re: Bizarre floating-point output

2007-01-08 Thread Richard Brodie
Nick Maclaren [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] x = (1.234567890125, 1.2345678901255) print x print x[0], x[1] (1.234567890124, 1.2345678901254999) 1.23456789012 1.23456789013 Is there a rational reason, or is that simply an artifact of the way that the code

recursive function

2007-01-08 Thread cesco
Hi, I have a dictionary of lists of tuples like in the following example: dict = {1: [(3, 4), (5, 8)], 2: [(5, 4), (21, 3), (19, 2)], 3: [(16, 1), (0, 2), (1, 2), (3, 4)]] In this case I have three lists inside the dict but this number is known only at runtime. I have to write a

Re: Table

2007-01-08 Thread skip
Someone know how do I get the collunm's number of a gkt.Table ? This is probably better asked on the pygtk mailing list. Your request seems underspecified. You want the column number given what input? A child widget of the Table? If so, look at gtk.Container's child_get_property method

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
In article [EMAIL PROTECTED], Richard Brodie [EMAIL PROTECTED] writes: | | When you do print on a tuple it doesn't recursively | call str(), so you get the repr representations. Ah! That explains it. I would call that reason intermediate between rational and an artifact of the way the code

Re: Why less emphasis on private data?

2007-01-08 Thread hg
sturlamolden wrote: The designers of Java, C++, C#, Ada95, Delphi, etc. seem to think that if an object's 'internal' variables or states cannot be kept private, programmers get an irresistible temptation to mess with them in malicious ways. But if you are that stupid, should you be

help: code formatter?

2007-01-08 Thread siggi
Hi all, as a newbie I have problems with formatting code of downloaded programs, because IDLE's reformatting capabilities are limited . Incorrect indentation, mixing of TAB with BLANKs or eol are often very nasty to correct. Is there a simple code formatter that first removes all indentations and

Re: Why less emphasis on private data?

2007-01-08 Thread Neil Cerutti
On 2007-01-08, Paul Rubin http wrote: 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):

Re: recursive function

2007-01-08 Thread Neil Cerutti
On 2007-01-08, cesco [EMAIL PROTECTED] wrote: Hi, I have a dictionary of lists of tuples like in the following example: dict = {1: [(3, 4), (5, 8)], 2: [(5, 4), (21, 3), (19, 2)], 3: [(16, 1), (0, 2), (1, 2), (3, 4)]] In this case I have three lists inside the dict but this

Re: Module to read svg

2007-01-08 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: 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.

Re: Why less emphasis on private data?

2007-01-08 Thread Neil Cerutti
On 2007-01-08, hg [EMAIL PROTECTED] wrote: sturlamolden wrote: The designers of Java, C++, C#, Ada95, Delphi, etc. seem to think that if an object's 'internal' variables or states cannot be kept private, programmers get an irresistible temptation to mess with them in malicious ways. But if

Re: lxml namespaces problem

2007-01-08 Thread Stefan Behnel
Maxim Sloyko wrote: 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

Re: help: code formatter?

2007-01-08 Thread Bjoern Schliessmann
siggi wrote: as a newbie I have problems with formatting code of downloaded programs, because IDLE's reformatting capabilities are limited . Incorrect indentation, mixing of TAB with BLANKs or eol are often very nasty to correct. Is there a simple code formatter that first removes all

Maybe a little bug of ipython 0.7.3 ?

2007-01-08 Thread [EMAIL PROTECTED]
I'm new to ipython, and i found it a very cool product. $ ipython Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] Type copyright, credits or license for more information. IPython 0.7.3 -- An enhanced Interactive Python. snip In [8]: a = range(1000) In [9]: a? Type:

Re: Bizarre floating-point output

2007-01-08 Thread Bjoern Schliessmann
Nick Maclaren wrote: Ah! That explains it. I would call that reason intermediate between rational and an artifact of the way the code has evolved! Which code has evolved? Those precision problems are inherent problems of the way floats are stored in memory. Regards, Björn -- BOFH excuse

Re: multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-08 Thread Bjoern Schliessmann
Ray Schumacher wrote: I'll be trying implementing some streaming next. Question, though: how can I unblock asyncore.loop(), Not at all. That's the way event loops work. or at least be able to interrupt it? Sorry for the stupid question, but why would you want to do that? Other

Re: help: code formatter?

2007-01-08 Thread Thomas Heller
siggi schrieb: Hi all, as a newbie I have problems with formatting code of downloaded programs, because IDLE's reformatting capabilities are limited . Incorrect indentation, mixing of TAB with BLANKs or eol are often very nasty to correct. Is there a simple code formatter that first

Books,resources..

2007-01-08 Thread Tarique
Hi all! i am new to this group and starting out with python as well.i have programming experience in 'c' so can you please suggest some standard references for python considering that i have some programming experience (though c is quite unrelated i guess) --

Re: Xah's Edu Corner: Introduction to 3D Graphics Programing

2007-01-08 Thread ajsiegel
Xah Lee wrote: Here's their license: http://www.vpython.org/webdoc/visual/license.txt I read it wrong before. Thanks for correction. This is superb! I'll be looking into vpython! Xah Of course it does what it does by resort to OpenGL and C++, so is part of the problem ;) I am looking

Re: PDF rendering toolkit?

2007-01-08 Thread Chris Mellon
On 1/5/07, Jorge Vargas [EMAIL PROTECTED] 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) I have found several project but none seem to do what I need. http://sourceforge.net/projects/pdfplayground seems like a

Suitability for long-running text processing?

2007-01-08 Thread tsuraan
I have a pair of python programs that parse and index files on my computer to make them searchable. The problem that I have is that they continually grow until my system is out of memory, and then things get ugly. I remember, when I was first learning python, reading that the python interpreter

Re: PDF rendering toolkit?

2007-01-08 Thread Jorge Vargas
On 1/6/07, Diez B. Roggisch [EMAIL PROTECTED] wrote: 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) No idea if there is a one-shot-kills-them-all solution out there - but if you have a way to go for windows, you might

Re: PDF rendering toolkit?

2007-01-08 Thread Jorge Vargas
On 1/8/07, Chris Mellon [EMAIL PROTECTED] wrote: On 1/5/07, Jorge Vargas [EMAIL PROTECTED] 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) I have found several project but none seem to do what I need.

Re: Suitability for long-running text processing?

2007-01-08 Thread tsuraan
After reading http://www.python.org/doc/faq/general/#how-does-python-manage-memory, I tried modifying this program as below: a=[] for i in xrange(33,127): for j in xrange(33,127): for k in xrange(33,127): for l in xrange(33, 127): a.append(chr(i)+chr(j)+chr(k)+chr(l)) import sys

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
In article [EMAIL PROTECTED], Bjoern Schliessmann [EMAIL PROTECTED] writes: | Nick Maclaren wrote: | | Ah! That explains it. I would call that reason intermediate | between rational and an artifact of the way the code has evolved! | | Which code has evolved? Those precision problems are

Re: Maybe a little bug of ipython 0.7.3 ?

2007-01-08 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: In [8]: a = range(1000) In [9]: a? Type: list Base Class: type 'list' String Form:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 ... 0, 981, 98 2, 983, 984, 985, 986, 987,

Re: Suitability for long-running text processing?

2007-01-08 Thread Felipe Almeida Lessa
On 1/8/07, tsuraan [EMAIL PROTECTED] wrote: [snip] The loop is deep enough that I always interrupt it once python's size is around 250 MB. Once the gc.collect() call is finished, python's size has not changed a bit. [snip] This has been tried under python 2.4.3 in gentoo linux and python 2.3

sys.exit versus raise SystemExit

2007-01-08 Thread Will McGugan
Hi, Is there any difference between calling sys.exit() and raise SystemExit? Should I prefer one over the other? Regards, Will McGugan -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

creating simple Python scripting interfaces via C++

2007-01-08 Thread Ben Sizer
I have Python embedded in a C++ application (yes, yes, I know, I'd prefer it the other way around too) and essentially need to expose some read-only values and functions to Python so it can be used to script the host application. When scripting a similar app in TCL, it's possible to associate

popen, Pipes with programs that expect user input

2007-01-08 Thread Alex
Hello everyone, I am writing a terminal server client-server application, that offers the client the ability to run commands on the server and read their output. So far everything works fine, but I encounter a problem with commands which require some sort of user input; i.e. they don't return

Re: Bizarre floating-point output

2007-01-08 Thread Fredrik Lundh
Nick Maclaren wrote: The use of different precisions for the two cases is not, however, and it is that I was and am referring to. that's by design, of course. maybe you should look repr up in the documentation ? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Suitability for long-running text processing?

2007-01-08 Thread tsuraan
I just tried on my system (Python is using 2.9 MiB) a = ['a' * (1 20) for i in xrange(300)] (Python is using 304.1 MiB) del a (Python is using 2.9 MiB -- as before) And I didn't even need to tell the garbage collector to do its job. Some info: It looks like the big difference between our

closed issue

2007-01-08 Thread Imbaud Pierre
I submitted a bug, to sourceforge. Was answered (pretty fast) the file I dealt with was the buggy part. I then submitted a bug to the file author, who agreed, and fixed. End of the story. All I could complain about, with the xml.dom library, is how obscure the exception context was: I did violate

Re: sys.exit versus raise SystemExit

2007-01-08 Thread [EMAIL PROTECTED]
Will McGugan wrote: Hi, Is there any difference between calling sys.exit() and raise SystemExit? Should I prefer one over the other? Regards, Will McGugan -- blog: http://www.willmcgugan.com sys.exit() raises a SystemExit, see http://docs.python.org/lib/module-sys.html --

Re: Parallel Python

2007-01-08 Thread robert
Duncan Booth wrote: Laszlo Nagy [EMAIL PROTECTED] wrote: The 'parallel python' site seems very sparse on the details of how it is implemented but it looks like all it is doing is spawning some subprocesses and using some simple ipc to pass details of the calls and results. I can't tell

Re: help: code formatter?

2007-01-08 Thread Chuck Rhode
siggi wrote this on Mon, Jan 08, 2007 at 03:33:21PM +0100. My reply is below. Is there a simple code formatter that first removes all indentations and then refomats correctly? Why, yes, there is: http://lacusveris.com/PythonTidy/PythonTidy.python -- .. Chuck Rhode, Sheboygan, WI, USA ..

Re: Walking The Right Path

2007-01-08 Thread Tim Daneliuk
Jakub Stolarski wrote: Tim Daneliuk napisal(a): Ah yes, moral philosophy and python all come together... Er, that is to day: Imagine you have this situation on a *nix filesystem: Symlink A: /foo - /usr/home Symlink B: /bar - /foo/username If I do this: import os print

Re: Suitability for long-running text processing?

2007-01-08 Thread Felipe Almeida Lessa
On 1/8/07, tsuraan [EMAIL PROTECTED] wrote: I just tried on my system (Python is using 2.9 MiB) a = ['a' * (1 20) for i in xrange(300)] (Python is using 304.1 MiB) del a (Python is using 2.9 MiB -- as before) And I didn't even need to tell the garbage collector to do its

Re: Suitability for long-running text processing?

2007-01-08 Thread Chris Mellon
On 1/8/07, Felipe Almeida Lessa [EMAIL PROTECTED] wrote: On 1/8/07, tsuraan [EMAIL PROTECTED] wrote: I just tried on my system (Python is using 2.9 MiB) a = ['a' * (1 20) for i in xrange(300)] (Python is using 304.1 MiB) del a (Python is using 2.9 MiB -- as before)

Re: Walking The Right Path

2007-01-08 Thread Tim Daneliuk
Tim Daneliuk wrote: Jakub Stolarski wrote: Tim Daneliuk napisal(a): IOW, is there a way to return a symlink-based path which contains the symlink pointer as is was *defined* not as it expands? One way (but very ugly): print os.path._resolve_link('/bar') Yup, that does just what I

Re: Suitability for long-running text processing?

2007-01-08 Thread tsuraan
$ python Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type help, copyright, credits or license for more information. # Python is using 2.7 MiB ... a = ['1234' for i in xrange(10 20)] # Python is using 42.9 MiB ... del a #

Re: AES256 in PyCrypto

2007-01-08 Thread Gabriel Genellina
At Sunday 7/1/2007 18:23, [EMAIL PROTECTED] wrote: Is a docstring is the text between the three consecutive quote characters in a .py file? The reason for the question is that I looked See section 4.6 in the Python Tutorial - I strongly suggest you read it (or any other introductory text

xmlrpc an auth-diget

2007-01-08 Thread Thomas Liesner
Hi all, this may have been asked before, but as a newbie with xmlrpc i can't find any suitable info on that. Sorry. I am trying to write a simple xmlrpc-client in python and the server i am trying to receive data from requires http auth digest. The info on xmlrpclib covers auth basic thrugh url

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] writes: | Nick Maclaren wrote: | | The use of different precisions for the two cases is not, however, | and it is that I was and am referring to. | | that's by design, of course. maybe you should look repr up in the |

xmlrpc and auth-digest

2007-01-08 Thread Thomas Liesner
Hi all, this may have been asked before, but as a newbie with xmlrpc i can't find any suitable info on that. Sorry. I am trying to write a simple xmlrpc-client in python and the server i am trying to receive data from requires http auth digest. The info on xmlrpclib covers auth basic thrugh url

Re: Suitability for long-running text processing?

2007-01-08 Thread tsuraan
My first thought was that interned strings were causing the growth, but that doesn't seem to be the case. Interned strings, as of 2.3, are no longer immortal, right? The intern doc says you have to keep a reference around to the string now, anyhow. I really wish I could find that thing I

Re: Walking The Right Path

2007-01-08 Thread Peter Otten
Tim Daneliuk wrote: IOW, is there a way to return a symlink-based path which contains the symlink pointer as is was *defined* not as it expands? os.readlink() Peter -- http://mail.python.org/mailman/listinfo/python-list

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

2007-01-08 Thread Gabriel Genellina
At Monday 8/1/2007 10:25, vizcayno wrote: However, what happens when the error is due to data error. Or when the program is reading many files to save data into a database and one or two files have problems with data format. I would like to keep the program running (using exception in a

A Good Intro to wxpython/PostgreSQL Applications?

2007-01-08 Thread PAllen
Hi all, I am trying to get rid of a few of my old MS Access applications and move them to PostgreSQL and Python/wxpython. Does anyone have any suggestions on the easiest way to learn to program small database applications with python wxpython? Does anyone have a few small examples at least? I

Re: Suitability for long-running text processing?

2007-01-08 Thread Chris Mellon
On 1/8/07, tsuraan [EMAIL PROTECTED] wrote: My first thought was that interned strings were causing the growth, but that doesn't seem to be the case. Interned strings, as of 2.3, are no longer immortal, right? The intern doc says you have to keep a reference around to the string now,

Re: Books,resources..

2007-01-08 Thread Bjoern Schliessmann
Tarique wrote: so can you please suggest some standard references for python considering that i have some programming experience I like Learning Python by Mark Lutz and David Ascher. They refer to C/C++ many times. Also try Dive into Python for a more fast-paced introduction and Python in a

Re: sys.exit versus raise SystemExit

2007-01-08 Thread Will McGugan
[EMAIL PROTECTED] wrote: sys.exit() raises a SystemExit, see http://docs.python.org/lib/module-sys.html Oh I know. I was just wondering if there was some sort of subtle 'best practice' recommendation that I wasnt aware of for using sys.exit over raising the exception manually. In the same

Re: recursive function

2007-01-08 Thread cesco
Neil Cerutti wrote: On 2007-01-08, cesco [EMAIL PROTECTED] wrote: Hi, I have a dictionary of lists of tuples like in the following example: dict = {1: [(3, 4), (5, 8)], 2: [(5, 4), (21, 3), (19, 2)], 3: [(16, 1), (0, 2), (1, 2), (3, 4)]] In this case I have three

Re: Bizarre floating-point output

2007-01-08 Thread Bjoern Schliessmann
Nick Maclaren wrote: I think that you should. Big words. Where does it say that tuple's __str__ is the same as its __repr__? Where does it say that a tuple's __str__ does not call its contents' __repr__? The obvious interpretation of the documentation is that a sequence type's __str__

Re: Bizarre floating-point output

2007-01-08 Thread Bjoern Schliessmann
Nick Maclaren wrote: The use of different precisions for the two cases is not, however, and it is that I was and am referring to. You mistake precision with display. Regards, Björn -- BOFH excuse #12: dry joints on cable plug -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-threaded webcam with SimpleAsyncHTTPServer.py

2007-01-08 Thread Gabriel Genellina
At Monday 8/1/2007 02:44, Ray Schumacher wrote: Question, though: how can I unblock asyncore.loop(), or at least be able to interrupt it? To kill this server I need to hit CNTRL-C and then attempt to GET an image from Firefox, Python then throws KetboardInterrupt. Why do you want to do

Re: Bizarre floating-point output

2007-01-08 Thread Ziga Seilnacht
Nick Maclaren wrote: I think that you should. Where does it say that tuple's __str__ is the same as its __repr__? The obvious interpretation of the documentation is that a sequence type's __str__ would call __str__ on each sub-object, and its __repr__ would call __repr__. How would you

Re: Why less emphasis on private data?

2007-01-08 Thread Jussi Salmela
Neil Cerutti kirjoitti: On 2007-01-08, hg [EMAIL PROTECTED] wrote: sturlamolden wrote: The designers of Java, C++, C#, Ada95, Delphi, etc. seem to think that if an object's 'internal' variables or states cannot be kept private, programmers get an irresistible temptation to mess with them in

  1   2   3   >