Re: Altering imported modules

2008-03-02 Thread Terry Reedy
Tro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hi, list. | | I've got a simple asyncore-based server. However, I've modified the asyncore | module to allow me to watch functions as well as sockets. The modified | asyncore module is in a specific location in my project and is

Re: First post from a Python newbiw

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 21:58:31 +0100, Christoph Zwerschke wrote: Marc 'BlackJack' Rintsch schrieb: On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: Apart from doing something like a=[0,0,0] b=[0,0,0] c=[0,0,0] d=[a,b,c] is there a better way of creating d?? a = [[0] * 3 for

Re: Altering imported modules

2008-03-02 Thread Tro
On Sunday 02 March 2008, Terry Reedy wrote: Tro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hi, list. | | I've got a simple asyncore-based server. However, I've modified the asyncore | module to allow me to watch functions as well as sockets. The modified | asyncore

Re: tuples, index method, Python's design

2008-03-02 Thread Roy Smith
In article [EMAIL PROTECTED], Paul Boddie [EMAIL PROTECTED] wrote: On 2 Mar, 19:06, Alan Isaac [EMAIL PROTECTED] wrote: On April 12th, 2007 at 10:05 PM Alan Isaac wrote: The avoidance of tuples, so carefully defended in other terms, is often rooted (I claim) in habits formed from

Re: First post from a Python newbiw

2008-03-02 Thread Terry Reedy
Christoph Zwerschke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Marc 'BlackJack' Rintsch schrieb: | On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: | | Apart from doing something like | a=[0,0,0] | b=[0,0,0] | c=[0,0,0] | d=[a,b,c] | | is there a better way of

Re: Book Recomendations

2008-03-02 Thread Micah Cowan
Tommy Nordgren [EMAIL PROTECTED] writes: On 2 mar 2008, at 01.56, Ira Solomon wrote: I am an experienced programmer (40 years). I've done Algol (if you've heard of that you must be old too), PL/1, VB,VBA, a little C, and a few other odd languages (e.g. Taskmate). I'm interested in learning

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
Christoph Zwerschke wrote: Marc 'BlackJack' Rintsch schrieb: On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: Apart from doing something like a=[0,0,0] b=[0,0,0] c=[0,0,0] d=[a,b,c] is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] Each element of a

Re: mod_python Unable to create file

2008-03-02 Thread Kaushik Barat
Hey thanks a lot Sean.Setting the permissions on the directory path solved the problem. On Sun, Mar 2, 2008 at 11:09 AM, Sean Allen [EMAIL PROTECTED] wrote: On Mar 2, 2008, at 3:24 AM, kaush wrote: On Mar 1, 11:24 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 01 Mar 2008

Re: Function Overloading and Python

2008-03-02 Thread castironpi
On Feb 25, 11:04 am, [EMAIL PROTECTED] wrote: B1.fun(A(x), A(y), A(z)) == B.fun(A(x), A(y), A(z)) but B1.fun(A1(x), A(y), A(z) != B.fun(A1(x), A(y), A(z)) Is there a data-structure solution or third party module that would mimic this behavior? class B:    xfun= Overloaded()    def

Re: How about adding rational fraction to Python?

2008-03-02 Thread Paul Rubin
Jeff Schwab [EMAIL PROTECTED] writes: Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring division operator? Are there any real use cases for such a type? User defined types in python are fairly heavyweight compared with the built-in types,

Re: First post from a Python newbiw

2008-03-02 Thread castironpi
is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] Each element of a refers to a distinct array. Why not simply [[0]*3]*3 ? All three elements of the result refer to the same array. ... whereas you reassign all three elements of [0]* 3. ((0,)*3,)*3 ((0, 0,

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: Jeff Schwab [EMAIL PROTECTED] writes: Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring division operator? Are there any real use cases for such a type? User defined types in python are fairly heavyweight compared

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] Each element of a refers to a distinct array. Why not simply [[0]*3]*3 ? All three elements of the result refer to the same array. ... whereas you reassign all three elements of [0]* 3.

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Fred Drake
On Mar 2, 2008, at 4:05 PM, Martin v. Löwis wrote: Assuming no major problems crop up, a final release of Python 2.4.4 will follow in about a week's time. I do suppose you mean 2.4.5. 2.4.5 won't build for me from the svn checkout on Mac OS X 10.5.2: gcc -fno-strict-aliasing

Re: Run Python app at startup

2008-03-02 Thread dave_mikesell
On Mar 2, 3:37 pm, SMALLp [EMAIL PROTECTED] wrote: Hy. I create simple application. Yust an windows and compile it with py2exe. I add registry value reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d C:\myapp.exe /f' And it wont start. When i use

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Fred Drake
On Mar 2, 2008, at 7:43 PM, Fred Drake wrote: 2.4.5 won't build for me from the svn checkout on Mac OS X 10.5.2: Neither does 2.3.7 now that I've tried that: gcc -u __dummy -u _PyMac_Error -framework System -framework CoreServices -framework Foundation -o python.exe \

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Brett Cannon
On Sun, Mar 2, 2008 at 4:52 PM, Fred Drake [EMAIL PROTECTED] wrote: On Mar 2, 2008, at 7:43 PM, Fred Drake wrote: 2.4.5 won't build for me from the svn checkout on Mac OS X 10.5.2: Neither does 2.3.7 now that I've tried that: gcc -u __dummy -u _PyMac_Error -framework System -framework

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Kevin Teague
It has to do with the MACOSX_DEPLOYMENT_TARGET. If it's set to 10.4, the legacy version of setpgrp is used (with args), it it's 10.5, setpgrp expects no arguments. It seems configure won't detect the difference. http://bugs.python.org/issue1358 This issue was fixed for Python 2.5. As the issue

Re: Altering imported modules

2008-03-02 Thread Paul McGuire
On Mar 2, 3:48 pm, Tro [EMAIL PROTECTED] wrote: On Sunday 02 March 2008, Terry Reedy wrote: Tro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hi, list. | | I've got a simple asyncore-based server. However, I've modified the asyncore | module to allow me to watch

Re: Book Recomendations

2008-03-02 Thread David Lees
Ira Solomon wrote: I am an experienced programmer (40 years). I've done Algol (if you've heard of that you must be old too), PL/1, VB,VBA, a little C, and a few other odd languages (e.g. Taskmate). I'm interested in learning Python and have downloaded a slew of books. Too many. I'd like a

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Fred Drake
On Mar 2, 2008, at 8:35 PM, Kevin Teague wrote: This issue was fixed for Python 2.5. As the issue notes, you can work around it with: ./configure MACOSX_DEPLOYMENT_TARGET=10.5 Indeed, that works wonderfully for me for 2.4.5. But it would be really nice if the configure fix for 2.5 was

Character Problem

2008-03-02 Thread Harun BAYKAL
Hi, I am studying on an addon developed for QGIS, a GIS software. But I have a problem. The extension has been developed with QT and Python. Actually Python is used for the interface design. For the user interface Python reads some values from some database files. I am not experienced Python user

Re: along the lines, hash and obj. id.

2008-03-02 Thread castironpi
On Feb 27, 5:38 pm, [EMAIL PROTECTED] wrote: On Feb 27, 4:16 pm, Gabriel Genellina [EMAIL PROTECTED] For a), you use something like obj.a.somemethod(). obj.a still refers to the same object, even if it changed internally; if obj.a and foo.bar both were refering to the same object, they

Organizing Books in My Amazon Cart

2008-03-02 Thread W. Watson
Anyone know of a way of listing all the books in my Amazon Shopping Cart--To Buy Latter? I have a considerable number, and working my way through the list is time consuming. Possibly someone has written a program to do it (Python, Perl, ...)? I have no idea if that's even possible. I figure

Re: Where's GUI for Python?

2008-03-02 Thread Roy H. Han
Hi Konrad, I remember taking a long time in deciding which GUI framework to use last year and I picked wxGlade/wxPython because it seemed mature, easy to use and easy to understand. In the beginning I wasted a lot of time coding the GUI manually but wxGlade lets me use the mouse to arrange the

Re: tcp

2008-03-02 Thread Gabriel Genellina
On 2 mar, 17:21, [EMAIL PROTECTED] wrote: This worked: import socket from time import time for i in range( 20 ):     HOST = ''     PORT = 80 #     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)     s.bind((HOST, PORT))     print( 'listen' )     s.listen(1)     conn, addr =

Re: How to subclass a built-in int type and prevent comparisons

2008-03-02 Thread Gabriel Genellina
En Fri, 29 Feb 2008 19:00:06 -0200, Bronner, Gregory [EMAIL PROTECTED] escribi�: I'm trying to create a type-safe subclass of int (SpecialInt) such that instances of the class can only be compared with ints, longs, and other subclasses of SpecialInt -- I do not want them to be compared with

Re: tcp

2008-03-02 Thread Roy Smith
In article [EMAIL PROTECTED], Gabriel Genellina [EMAIL PROTECTED] wrote: On 2 mar, 17:21, [EMAIL PROTECTED] wrote: This worked: import socket from time import time for i in range( 20 ):     HOST = ''     PORT = 80 #     s = socket.socket(socket.AF_INET,

Is it possible to return a variable and use it...?

2008-03-02 Thread Nathan Pinno
Hello all, Is it possible to return a variable and then use it like the following: [code] dir exp_1: while hen != * sum = sum + hen return sum dir exp_2: if sum = total_needed: print Profit can be made. else: print Expect a loss. total_needed = int(raw_input(What

Re: Python-based regular expression parser that allows patterns to call functions?

2008-03-02 Thread Paul McGuire
pyparsing also includes a decorator function, traceParseAction, which will list out calls to parse actions, the tokens passed in, and the value returned or exception raised. If you add @traceParseAction before each of the parse actions in my example, you can see the token processing being done in

Re: Python Telnet formatting?

2008-03-02 Thread Jean-Paul Calderone
On Sat, 1 Mar 2008 16:51:08 -0800 (PST), [EMAIL PROTECTED] wrote: Hi everyone: I posted here a couple days ago looking for some help creating a Telnet-based chat server. You guys pointed me to Twisted, which has solved most of my issues. However, what I want to do is analyze strings received for

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-02 Thread Tim Roberts
Jeremy Nicoll - news posts [EMAIL PROTECTED] wrote: Does every Windows user have: 2 C:\WINDOWS\system32\python25.zip in their sys.path? What's the point of having a zip in the path? Starting with Python 2.4, Python is able to import modules directly from a zip, as if it were a directory. It's

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-02 Thread Tim Roberts
Kay Schluehr [EMAIL PROTECTED] wrote: On 2 Mrz., 06:53, Ben Finney [EMAIL PROTECTED] wrote: One of the stated goals of the migration is that the '2to3' program will only migrate Python 2.6 code - Python 3.0 code. Yes, I know. Why? The master said so isn't an entirely satisfying answer.

Re: SQLLITE

2008-03-02 Thread Daniel Fetchinson
I am having a minor problem when I try and do this: c.execute(insert into [tblTranscripts] (MovieID,Transcript) Values( + movieID + ,' + formatText + ');) (don't even bother commenting of the sql style I know its bad form but this is a simple script). Whenever I try and do the

Re: SV: Where's GUI for Python?

2008-03-02 Thread Tim Roberts
K Viltersten [EMAIL PROTECTED] wrote: As long as we're on the subject, i also wonder if there's a general concensus on which technology is recommended in the different types of projects that are developed. (E.g. use A for small/fast fixes, use B for stuff you'll need to maintain later on.)

Re: class object interface document

2008-03-02 Thread Neil.Fang.CN
Thanks for your reply. What is the counterpart in v3.0? -- Neil On Mar 2, 6:26 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Sun, 02 Mar 2008 00:55:23 -0200, Neil.Fang.CN [EMAIL PROTECTED]   escribió: Where can I find the Python class object interface document, such as struct

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
Assuming no major problems crop up, a final release of Python 2.4.4 will follow in about a week's time. I do suppose you mean 2.4.5. Oops, yes. 2.4.5 won't build for me from the svn checkout on Mac OS X 10.5.2: gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
But it would be really nice if the configure fix for 2.5 was backported to 2.4.5 since Zope is still on 2.4 and Mac OS X skipped system builds for 2.4 going direct from 2.3 - 2.5. Yes, it would be very nice if this worked out of the box on Mac OS X 10.5.2. It's definitely a surprise

Re: class object interface document

2008-03-02 Thread Gabriel Genellina
En Mon, 03 Mar 2008 04:37:38 -0200, Neil.Fang.CN [EMAIL PROTECTED] escribió: On Mar 2, 6:26 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Sun, 02 Mar 2008 00:55:23 -0200, Neil.Fang.CN [EMAIL PROTECTED]   escribió: Where can I find the Python class object interface document, such as

Re: Is it possible to return a variable and use it...?

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Sun, 02 Mar 2008 20:15:10 -0800, Nathan Pinno wrote: Hello all, Is it possible to return a variable and then use it like the following: [code] dir exp_1: while hen != * sum = sum + hen return sum dir exp_2: if sum = total_needed: print Profit can be made.

Re: Character Problem

2008-03-02 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Mar 2008 04:27:52 +0200, Harun BAYKAL wrote: I am studying on an addon developed for QGIS, a GIS software. But I have a problem. The extension has been developed with QT and Python. Actually Python is used for the interface design. For the user interface Python reads some values

Re: Run Python app at startup

2008-03-02 Thread Gabriel Genellina
En Sun, 02 Mar 2008 19:37:35 -0200, SMALLp [EMAIL PROTECTED] escribi�: Hy. I create simple application. Yust an windows and compile it with py2exe. I add registry value reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d C:\myapp.exe /f' And

[issue2216] Problems using logging module with idle

2008-03-02 Thread Andrea Griffini
New submission from Andrea Griffini: I'm not a user of idle, but when asked about a strange behaviour of the logging module I digged a bit and found what I think is indeed a problem in the module itself. The problem is visible if the module is used from idle (or any other IDE that keeps the same

[issue2200] find_executable fails to find .bat files on win32

2008-03-02 Thread Lev Shamardin
Lev Shamardin added the comment: Here is my vision of this patch. I don't think that it is necessary to fall back to 'com/exe/bat' if PATHEXT is not set, since it must be set on any correctly configured Win32 platform. -- keywords: +patch Added file:

[issue687648] classic division in demos/ directory

2008-03-02 Thread Robert Schuppenies
Robert Schuppenies added the comment: The attached patch applies floor division to all classic divisions where only integer input was used, and true division where at least on input parameter was of non-integral type. In cmptree.py I replaced int(size/dt) with size//dt as it has the same

[issue1672853] Error reading files larger than 4GB

2008-03-02 Thread Joseph Armbruster
Joseph Armbruster added the comment: Just got in from New Smyrna beach... and the verdict is: URL: http://svn.python.org/projects/python/branches/release25-maint Revision: 61182 python bigfiletest1.py 1 2 3 4 5 6 7 8 9 10 11 12 13 14

[issue2217] Problem with if clause in generator expression on class level

2008-03-02 Thread Georg Brandl
Georg Brandl added the comment: The actual equivalent would be class A: a = 'test' def __g(_x): for c in _x: if c in a: yield c tuple(__g(a)) i.e. the outmost iterator is evaluated in the enclosing scope; not the if clause is in its own scope,

[issue2215] test_sqlite fails in 2.6a1 on MacOS X

2008-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think this is Mac specific---one of the linux buildbots has also been having this problem, it seems. I think it's a result of having an older version of sqlite3 installed. My OS X 10.4 box has sqlite3 version 3.1.3 installed, and that version doesn't

[issue2217] Problem with if clause in generator expression on class level

2008-03-02 Thread Christoph Zwerschke
Christoph Zwerschke added the comment: Thanks, this now makes sense to me. You're right, it's rather an ugly wart than a bug. But I think the Python reference needs to be improved to make this clear enough. How about the following proposed addtions (in square brackets) to section 5.2.5

[issue1736190] asyncore/asynchat patches

2008-03-02 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I've discussed a lot with Josiah via e-mail and this is the updated version of the patch including a fix for the two issues raised before. This update has been needed also because the original patch has been out-dated by some commits after r53734 involving

[issue2218] Enhanced hotshot profiler with high-resolution timer

2008-03-02 Thread Jean Brouwers
New submission from Jean Brouwers: The _hotshot module uses the gettimeofday function to profile the run time. I enhanced the hotshot module in Python 2.5.2 to use a high resolution timer where available (RDTSC on x86/_64, MFTB/U on PowerPC and gethrtime on Solaris). The improved hotshot

[issue2215] test_sqlite fails in 2.6a1 on MacOS X

2008-03-02 Thread Gerhard Häring
Gerhard Häring added the comment: Revision 61141 made the test work with old SQLite versions. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2215 __ ___ Python-bugs-list mailing

[issue2215] test_sqlite fails in 2.6a1 on MacOS X

2008-03-02 Thread Gerhard Häring
Changes by Gerhard Häring: __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2215 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2215] test_sqlite fails in 2.6a1 on MacOS X

2008-03-02 Thread Gerhard Häring
Gerhard Häring added the comment: r61174 made the tests work with old SQLite versions. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2215 __ ___ Python-bugs-list mailing list

[issue2179] with should be as fast as try/finally

2008-03-02 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Here's a proof-of-concept patch that keeps the __exit__ method on the stack. It uses ROT_TWO to stuff it under the context object instead of storing it into a temporary. (Thanks Nick for pointing out that problem before I had to waste time on it.) test_with

[issue1740] use unittest for test_logging

2008-03-02 Thread Brett Cannon
Brett Cannon added the comment: Committed in r61189 on the trunk. Thanks, Antoine! -- status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1740 __ ___

<    1   2