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

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

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

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

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

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

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 lat

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

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 satisf

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

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 receiv

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 i

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

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

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 w

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

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 co

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 thi

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 objec

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

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

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 issu

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 lik

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

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 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 -Wno-long-do

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

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 elem

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 co

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

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

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 ty

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

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 xran

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

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

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

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

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?

Re: tuples, index method, Python's design

2008-03-02 Thread Christoph Zwerschke
Paul Boddie schrieb: > 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 >>> need for list methods like ``index`` and `

Run Python app at startup

2008-03-02 Thread SMALLp
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 console instead od window in py2exe i get console opend

Re: First post from a Python newbiw

2008-03-02 Thread Steve Turner
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

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-02 Thread Ben Finney
Kay Schluehr <[EMAIL PROTECTED]> writes: > 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 entire

Re: Book Recomendations

2008-03-02 Thread Jeff Schwab
> Ira Solomon wrote: >> I am an experienced programmer (40 years) . . . >> I'm interested in learning Python > js wrote: >> I wonder why nobody mension Python Cookbook yet . . . >> and Python Standard Library Because cookbooks are not supposed to be language introductions. They are collec

Re: tcp

2008-03-02 Thread Gif
thanks everybody, i've got this to work. i'm not trying to write an actual web server, i'm just using it for some procedures like URL rewriting. -- http://mail.python.org/mailman/listinfo/python-list

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

sympy: nifty, but... (was: How about adding rational fraction to Python?)

2008-03-02 Thread Mensanator
On Mar 1, 12:29 pm, "Anand Patil" <[EMAIL PROTECTED]> wrote: > Not sure if this is common knowledge yet but > Sympy,http://code.google.com/p/sympy, has a rational type. I hadn't heard of this before, thanks for the link. Very nifty, lots of goodies not found in gmpy (although it seems to lack a

Re: tuples, index method, Python's design

2008-03-02 Thread Alan Isaac
Paul Boddie wrote: > Here's the tracker item that may have made it happen: > http://bugs.python.org/issue1696444 > I think you need to thank Raymond Hettinger for championing the > cause. ;-) Yes indeed! Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-02 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release candidates of Python 2.4.5 and 2.4.5. Both releases include only security fixes. Python 2.5 is the latest version of Python, we're making this release for people who are still running Python 2.3 or

Re: First post from a Python newbiw

2008-03-02 Thread Christoph Zwerschke
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)] Why not simply [[0]*3]*3 ? --

Re: Altering imported modules

2008-03-02 Thread Tro
On Saturday 01 March 2008, Tro wrote: > 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 > imported as usual from my cl

Re: Network server- / client-side messaging

2008-03-02 Thread castironpi
''' Last time, we left off at: ''' class InterfaceClientSide( ClientSide ): message= MessageDec() incremental= message.incremental() settings= AYT( .5, 3 ) user_act= message.out() def __init__( self, image ): self._image= image

Re: tuples, index method, Python's design

2008-03-02 Thread Paul Boddie
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 > > need for list methods like ``index`` and ``count``. > > Indeed, I p

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > I can live with int/int=float but > find it sloppy and would be happier if int/int always threw an error > (convert explicitly if you want a particular type result). Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring divisi

Re: cx_Freeze : LookupError: unknown encoding: ascii

2008-03-02 Thread Rakesh Kumar
On Mar 1, 3:41 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Can somebody point to some clues about options that need to be passed > > to FreezePython API to get the right executable. > > You need to tell it to include the encodings.ascii module. > > Regards, > Martin Thanks Martin. Addin

Re: tcp

2008-03-02 Thread castironpi
On Mar 2, 11:38 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Nobody thinks you are a fool for wanting help with your problems, it's > simply that you have to provide enough information about what' wring for > us to get a handle on the issues. This worked: import socket from time import time for

Re: Beginner's assignment question

2008-03-02 Thread Schizoid Man
Gabriel Genellina wrote: > En Sun, 02 Mar 2008 08:25:49 -0200, Schizoid Man <[EMAIL PROTECTED]> escribi�: > >> Lorenzo Gatti wrote: >>> On Mar 1, 3:39 pm, Schizoid Man <[EMAIL PROTECTED]> wrote: As in variable assignment, not homework assignment! :) I understand the first line but n

RE: Escaping a triple quoted string' newbie question

2008-03-02 Thread Jules Stevenson
> > float $pos[]=particleShape1.worldPosition; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".tx") $pos[0]; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".ty") $pos[1]; > > > > setAttr ("heartPP_1_"+particleShape1.particleId+".tz") $pos[2]; > > """ > > dynExpression (p, s=expR

Re: mod_python Unable to create file

2008-03-02 Thread Sean Allen
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 22:47:02 -0800, kaush wrote: >>> I am using Apache and mod_python to service POST/GET requests on MAC >>> OS. My script tries to create a file >> >>> file = op

Re: Problem with the strip string method

2008-03-02 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> I suspect what you need is the .replace() method. > > The information's there-- the word 'contiguous' might clear it up a > bit. > >>> Return a copy of the string with the >>> leading and trailing characters

Re: Question on importing and function defs

2008-03-02 Thread castironpi
On Mar 2, 11:44 am, Steve Holden <[EMAIL PROTECTED]> wrote: > TC wrote: > > On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: > >> TC wrote: > >>> I have a problem.  Here's a simplified version of what I'm doing: > >>> I have functions a() and b() in a module called 'mod'.  b() calls a().

Re: Beautiful Code in Python?

2008-03-02 Thread castironpi
On Mar 2, 12:01 pm, John DeRosa <[EMAIL PROTECTED]> wrote: > On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: > >Hi, > > >Have you ever seen Beautiful Python code? > >Zope? Django? Python standard lib? or else? > > >Please tell me what code you think it's stunning. > > Just about an

Re: Problem with the strip string method

2008-03-02 Thread castironpi
On Mar 2, 11:45 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I suspect what you need is the .replace() method. The information's there-- the word 'contiguous' might clear it up a bit. > > Return a copy of the string with the > > leading and trailing characters removed. > > The chars argument is

Re: tuples, index method, Python's design

2008-03-02 Thread Alan Isaac
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 > need for list methods like ``index`` and ``count``. > Indeed, I predict that Python tuples will eventually have > these met

Re: Beautiful Code in Python?

2008-03-02 Thread John DeRosa
On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: >Hi, > >Have you ever seen Beautiful Python code? >Zope? Django? Python standard lib? or else? > >Please tell me what code you think it's stunning. Just about any Python code I look at. -- http://mail.python.org/mailman/listinfo/py

Re: Problem with the strip string method

2008-03-02 Thread Steve Holden
Colin J. Williams wrote: > The Library Reference has > strip( [chars]) > > Return a copy of the string with the > leading and trailing characters removed. > The chars argument is a string > specifying the set of characters to be > removed. If omitted or None, the chars > argument defaults to

Re: Question on importing and function defs

2008-03-02 Thread Steve Holden
TC wrote: > On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: >> TC wrote: >>> I have a problem. Here's a simplified version of what I'm doing: >>> I have functions a() and b() in a module called 'mod'. b() calls a(). >>> So now, I have this program: >>> from mod import * >>> def a(): >>

Re: tcp

2008-03-02 Thread Steve Holden
Gif wrote: > i would like to apologize once more. i understand that you are saying > "what a fool he is waiting for us to solve all his problems", cause > i've said that for other posts, when they seemed "immature". It's just > that i couldn't find a way out of 20 lines of code and this drove me >

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
On Sun, 2 Mar 2008 06:15:54 -0800 (PST) Giles Brown <[EMAIL PROTECTED]> wrote: > http://docs.python.org/lib/typeiter.html Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-03-02 Thread Paul Rubin
Robert Brown <[EMAIL PROTECTED]> writes: > Unfortunately, performance often comes at the cost of safety and > correctness. Optimized C programs can crash when pointers walk off the > end of arrays or they can yield incorrect results when integers overflow > the limits of the hardware. Yes, even u

Re: Problem with the strip string method

2008-03-02 Thread Martin Blume
"Colin J. Williams" schrieb > The Library Reference has > strip( [chars]) > > Return a copy of the string with the > leading and trailing characters removed. It's "leading and trailing", not "leading, trailing or embedded". >>> "xxxaaaxxx".strip("x") 'aaa' >>> "xxxaaax

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

2008-03-02 Thread Paul McGuire
On Mar 2, 8:41 am, Andrew Warkentin <[EMAIL PROTECTED]> wrote: > I am writing a filtering HTTP proxy (the site > ishttp://xuproxy.sourceforge.net/). I want it to be compatible with > Proxomitron (http://proxomitron.info/) filters. I need a regular > expression parser that allows patterns to call f

Re: Question on importing and function defs

2008-03-02 Thread TC
On Mar 2, 11:37 am, Gary Herron <[EMAIL PROTECTED]> wrote: > TC wrote: > > I have a problem. Here's a simplified version of what I'm doing: > > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > > So now, I have this program: > > > from mod import * > > > def a(): > >

Re: Problem with the strip string method

2008-03-02 Thread Jorge Godoy
Colin J. Williams wrote: > Return a copy of the string with the > leading and trailing characters removed. > Only the last two examples below behave > as expected. They all looks OK to me. > [Dbg]>>> 'ab$%\n\rcd'.strip('%') > 'ab$%\n\rcd' No "%" at the beginning or end o

SV: Keeping the console window

2008-03-02 Thread K Viltersten
> You may use python in interactive mode: > > $ python -i yourScript.py > > Or use a blocking readline: > > $ cat yourScript.py > import sys > sys.stdin.readline() Thanks guys! -- Regards Konrad Viltersten sleep- a substitute for coffee for the poor ambiti

Problem with the strip string method

2008-03-02 Thread Colin J. Williams
The Library Reference has strip( [chars]) Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is

Re: How about adding rational fraction to Python?

2008-03-02 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > You hit the right note, but what I meant is the numeric type > unification would make it _appear_ to consist of a single numeric type > (yeah, I know it isn't actually, but what appears from outside isn't > always what's inside). That is clearly not intended; floa

Re: Beautiful Code in Python?

2008-03-02 Thread Michele Simionato
On Mar 2, 5:23 pm, js <[EMAIL PROTECTED]> wrote: > Hi, > > Have you ever seen Beautiful Python code? > Zope? Django? Python standard lib? or else? > > Please tell me what code you think it's stunning. The doctest module in the standard library. M.S. -- http://mail.python.org/mailman/listinfo/py

Re: Question on importing and function defs

2008-03-02 Thread Gary Herron
TC wrote: > I have a problem. Here's a simplified version of what I'm doing: > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > So now, I have this program: > > from mod import * > > def a(): > blahblah > > b() > > > The problem being, b() is calling the a() that's

SV: Where's GUI for Python?

2008-03-02 Thread K Viltersten
>> You should also take a look at wxGlade: >> >> http://wxglade.sourceforge.net/ >> >> which sits on top of wxPython: >> >> http://wxpython.org/ >> >> which wraps wxWidgets: >> >> http://www.wxwindows.org/ > > I have used wxGlade, and while it worked well > enough, it didn't see

Re: Question on importing and function defs

2008-03-02 Thread Nick Miller
TC wrote: > I have a problem. Here's a simplified version of what I'm doing: > > I have functions a() and b() in a module called 'mod'. b() calls a(). > > So now, I have this program: > > from mod import * > > def a(): > blahblah > > b() > > > The problem being, b() is calling the a() that's

Re: How about adding rational fraction to Python?

2008-03-02 Thread Lie
On Mar 2, 10:02 pm, Paul Rubin wrote: > Lie <[EMAIL PROTECTED]> writes: > > Anyway, I don't think Python should > > work that way, because Python have a plan for numerical integration > > which would unify all numerical types into an apparent single type, > > which requir

Beautiful Code in Python?

2008-03-02 Thread js
Hi, Have you ever seen Beautiful Python code? Zope? Django? Python standard lib? or else? Please tell me what code you think it's stunning. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread Preben Randhol
On Sun, 2 Mar 2008 08:09:24 -0800 (PST) [EMAIL PROTECTED] wrote: > On Mar 2, 8:15 am, Giles Brown <[EMAIL PROTECTED]> wrote: > > http://docs.python.org/lib/typeiter.html > > Be careful on your descision to return an ordered iterator or not-- > that is, whether it iterates over the dictionary or

Question on importing and function defs

2008-03-02 Thread TC
I have a problem. Here's a simplified version of what I'm doing: I have functions a() and b() in a module called 'mod'. b() calls a(). So now, I have this program: from mod import * def a(): blahblah b() The problem being, b() is calling the a() that's in mod, not the new a() that I wa

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-02 Thread castironpi
On Mar 2, 8:15 am, Giles Brown <[EMAIL PROTECTED]> wrote: > On Mar 2, 2:08 pm, Preben Randhol > [EMAIL PROTECTED]> wrote: > > On Sun, 2 Mar 2008 15:06:17 +0100 > > > Preben Randhol <[EMAIL PROTECTED]> wrote: > > >    class dbase(list): > > > Sorry the definition of the class is: > > >         clas

Re: Book Recomendations

2008-03-02 Thread James Matthews
I liked Core Python Programming 2nd edition! On Sun, Mar 2, 2008 at 4:27 PM, Ken Dere <[EMAIL PROTECTED]> wrote: > 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

Re: Keeping the console window

2008-03-02 Thread castironpi
On Mar 2, 9:55 am, Sam <[EMAIL PROTECTED]> wrote: > You may use python in interactive mode: > > $ python -i yourScript.py > > Or use a blocking readline: > > $ cat yourScript.py > import sys > sys.stdin.readline() > > ++ > > Sam FWIW, for what it's worth, you can invoke the interpreter from a batc

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

2008-03-02 Thread castironpi
On Mar 2, 8:41 am, Andrew Warkentin <[EMAIL PROTECTED]> wrote: > I am writing a filtering HTTP proxy (the site > ishttp://xuproxy.sourceforge.net/). I want it to be compatible with > Proxomitron (http://proxomitron.info/) filters. I need a regular > expression parser that allows patterns to call f

Re: tcp

2008-03-02 Thread Diez B. Roggisch
Gif schrieb: > sorry for acting like a fool but this is just to weirdly easy that i > can't get to work. i've written a small web server in another language > and this is more like copying code. > i already have everything figured out, except this one but noone seems > either willing or capable of

Re: Keeping the console window

2008-03-02 Thread Sam
You may use python in interactive mode: $ python -i yourScript.py Or use a blocking readline: $ cat yourScript.py import sys sys.stdin.readline() ++ Sam -- http://mail.python.org/mailman/listinfo/python-list

Network server- / client-side messaging

2008-03-02 Thread castironpi
''' a website wants to show you different arrangements of framed pictures on a wall. you can click, drag, scale, and rotate pictures in place. you can also drag new pictures in to it. spacing is uniform and settable-- if you rotate one, the readout of the total square area changes along with the

Re: Python's BNF

2008-03-02 Thread MartinRinehart
Gabriel Genellina wrote: > About the generated page: I think it would be more useful if each symbol > links to its definition, instead of showing an alert(). This way it's > easier to navigate the tree, specially with complex declarations. That was my first shot. It didn't work. (Every line is it

Re: Book Recomendations

2008-03-02 Thread Ken Dere
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 li

Re: Python Telnet formatting?

2008-03-02 Thread Grant Edwards
On 2008-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 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. And we told you that you needed to implement the telnet protocol. > The

Re: tcp

2008-03-02 Thread Grant Edwards
On 2008-03-02, Gif <[EMAIL PROTECTED]> wrote: > sorry for acting like a fool but this is just to weirdly easy > that i can't get to work. i've written a small web server in > another language and this is more like copying code. i already > have everything figured out, except this one but noone see

Re: tcp

2008-03-02 Thread Gif
i would like to apologize once more. i understand that you are saying "what a fool he is waiting for us to solve all his problems", cause i've said that for other posts, when they seemed "immature". It's just that i couldn't find a way out of 20 lines of code and this drove me mad. i end this topi

Re: How about adding rational fraction to Python?

2008-03-02 Thread Paul Rubin
Lie <[EMAIL PROTECTED]> writes: > That's quite complex and restrictive, but probably it's because my > mind is not tuned to Haskell yet. That aspect is pretty straightforward, other parts like only being able to do i/o in functions having a special type are much more confusing. > Anyway, I don't

  1   2   >