Re: Grouping code by indentation - feature or ******?

2005-03-28 Thread Antoon Pardon
Op 2005-03-25, Dennis Lee Bieber schreef <[EMAIL PROTECTED]>: > On 25 Mar 2005 14:26:28 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> 1) It makes it hard to see how many levels are dedented at the end of >>a suite, and sometime makes it difficult

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread alainpoint
Patrick Useldinger wrote: > cjl wrote: > Depends on what language you know best. But Java is certainly easier to read than C++. There is a difference between theory and practice. In theory, Java is easier to read than C++. In practice however, the average Java programmer is MUCH less talented

Re: Grouping code by indentation - feature or ******?

2005-03-28 Thread Antoon Pardon
Op 2005-03-25, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: >> Normally one is the project leader. He decides. > > Whishful thinking. > > Another problem I have with code that is _not_ layouted the way I'm used to > it is that the perception of what very code does gets more difficult to me. > You

Re: hiding a frame in tkinter

2005-03-28 Thread faramarz yari
lots of thanks to the nice guys of python community, i do it ,and it works just as i want, but unfourtunatly a new problem arise. the problem is : when i use pack_forget , i just work, but suppose we want to call it in func or method, i choose to test it in a func: def do_unpack(f): f.pack_f

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread Steven Bethard
Axel Straschil wrote: I came to the following: For single inheritance, super is a nice tool if you will recfactoring the class later. For multiple inheritance, if you want to use super, you have to have very much knowledge of the classes you inheritance. And for multiple inheritance, if you don't

Re: Little Q: how to print a variable's name, not its value?

2005-03-28 Thread Dan Bishop
[EMAIL PROTECTED] wrote: > No doubt I've overlooked something obvious, but here goes: > > Let's say I assign a value to a var, e.g.: > myPlace = 'right here' > myTime = 'right now' > > Now let's say I want to print out the two vars, along with their names. > I could easily do this: > print "myPlac

Re: Numarray newbie question

2005-03-28 Thread Robert Kern
ChinStrap wrote: I know there are probably alternatives for this with the standard library, but I think that would kill the speed I get with numarray: Say I have two 2-dimensional numarrays (x_mat and y_mat, say), and a function f(x,y) that I would like to evaluate at every index. Basically I want

Re: author index for Python Cookbook 2?

2005-03-28 Thread Cappy2112
Yes mentioned on Page 25, recipe 1.11. It may not be the context you were expecting, but it's your name. -- http://mail.python.org/mailman/listinfo/python-list

How to build pyogg/pyvorbis for Python 2.3 with MinGW

2005-03-28 Thread news.siol.net
Can someone please tell me how to compile pyogg/pyvorbis for Python 2.3 with MinGW. Thanks. Tom -- http://mail.python.org/mailman/listinfo/python-list

Re: Little Q: how to print a variable's name, not its value?

2005-03-28 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-03-29 01:06: No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two vars, along with their names. I could easily do t

Numarray newbie question

2005-03-28 Thread ChinStrap
I know there are probably alternatives for this with the standard library, but I think that would kill the speed I get with numarray: Say I have two 2-dimensional numarrays (x_mat and y_mat, say), and a function f(x,y) that I would like to evaluate at every index. Basically I want to be able to sa

Re: collaborative text editor

2005-03-28 Thread Andrew Dalke
Bryan wrote: > at pycon, several mac users were using a collaborative text editor where each > user's text background color was a different color as they edited the same > document at the same time while they took notes during the lectures. does > anyone know the name of that program? SubEth

Re: 133+ Tutorials and counting...

2005-03-28 Thread [EMAIL PROTECTED]
There's a Tkinter wiki for helping beginners: http://tkinter.unpy.net/wiki S -- http://mail.python.org/mailman/listinfo/python-list

Newbiw - PypenGL and OpenGLContext

2005-03-28 Thread Steve T
I have been searching for a language to help with a product I am developing - last week I discovered PYOpenGL - looks really useful. I found some demos which I studied to create part of what I need (a heap of boxes) but when I try and add an image to the box faces it looks as if I have to delve in

Little Q: how to print a variable's name, not its value?

2005-03-28 Thread [EMAIL PROTECTED]
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two vars, along with their names. I could easily do this: print "myPlace = %s, myTime = %s" % (myPlace, myTime)

Re: author index for Python Cookbook 2?

2005-03-28 Thread Steve Holden
Cappy2112 wrote: I'm pretty sure I saw your name in one of the recipes for the new book. Why not email Oreilly Jonathan Gennick might be interested in pointing people at that information. Unfortunately for reasons oo tedious to detail I can't mail him directly right now, but I know he's emailed t

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread Axel Straschil
Hello! Thanks to all for the very interesting postings! I came to the following: For single inheritance, super is a nice tool if you will recfactoring the class later. For multiple inheritance, if you want to use super, you have to have very much knowledge of the classes you inheritance. For m

Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread Paul Rubin
Anon <[EMAIL PROTECTED]> writes: > I'd like to get to the next level, but I'm not sure how. Are there > any suggestions for continuing to learn? How did you guys learn? I'd say look at some more general computer science books, maybe not Python based. -- http://mail.python.org/mailman/listinfo

Re: What's the best GUI toolkit in Python,Tkinter,wxPython,QT,GTK?

2005-03-28 Thread [EMAIL PROTECTED]
Tom, there's a reason that Tkinter is included with Python - it's probably the most straitforward of the 4 you mentioned. It's dead easy to get running on Win32 and Linux systems (haven't tried on Mac OS, but I hear reports of it being used). I found GTK to be damn near impossible to install on W

Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread Steve Holden
Anon wrote: I've gotten off to a good start for programming using Python (my first programming language). I can do the basics (different kinds of loops, variables, functions), but I'm not too good with classes yet. I've written some really small programs just for kicks (most involve statistic

Re: Max files in unix folder from PIL process

2005-03-28 Thread Rowdy
David Pratt wrote: Hi. I am creating a python application that uses PIL to generate thumbnails and sized images. It is beginning to look the volume of images will be large. This has got me to thinking. Is there a number that Unix can handle in a single directory. I am using FreeBSD4.x at the

Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread Brian van den Broek
Anon said unto the world upon 2005-03-29 00:07: I've gotten off to a good start for programming using Python (my first programming language). I can do the basics (different kinds of loops, variables, functions), but I'm not too good with classes yet. I've written some really small programs jus

Re: [Newbie] How do I get better at Python programming?

2005-03-28 Thread James Stroud
You've come to the right place. Lurk on this list for a while and read interesting threads. These guys here will teach you something. I personally learn about 2 new python concepts a day here. That being said, go back and read the "Python Cookbook, 2'nd. Edition is published" thread that start

[Newbie] How do I get better at Python programming?

2005-03-28 Thread Anon
I've gotten off to a good start for programming using Python (my first programming language). I can do the basics (different kinds of loops, variables, functions), but I'm not too good with classes yet. I've written some really small programs just for kicks (most involve statistics of differe

$6.00 to $20,000 in 4-6 weeks.* Legal Home Business!!!

2005-03-28 Thread katama
Internet Home Business Minimum financial requirements: Any credit, debit or bank account with at least $6.00 balance. Minimum computer literacy: Follow onscreen instructions and operate a mouse. Minimum time investment to start: Approximately (5) hour's computer time on-li

Re: collaborative text editor

2005-03-28 Thread Ed Leafe
On Mar 28, 2005, at 11:13 PM, Bryan wrote: at pycon, several mac users were using a collaborative text editor where each user's text background color was a different color as they edited the same document at the same time while they took notes during the lectures. does anyone know the name of t

Re: Win32 or Unix check in python

2005-03-28 Thread Erik Max Francis
GujuBoy wrote: how can you check in python at the beginning if you running the app in WIN32 or UNIX. import sys print sys.platform -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Some mistakes we must carry with

Win32 or Unix check in python

2005-03-28 Thread GujuBoy
how can you check in python at the beginning if you running the app in WIN32 or UNIX. please help -- http://mail.python.org/mailman/listinfo/python-list

collaborative text editor

2005-03-28 Thread Bryan
at pycon, several mac users were using a collaborative text editor where each user's text background color was a different color as they edited the same document at the same time while they took notes during the lectures. does anyone know the name of that program? it was one of the coolest thi

Re: Python for a 10-14 years old?

2005-03-28 Thread Joal Heagney
Lee Harr wrote: On 2005-03-27, Joal Heagney <[EMAIL PROTECTED]> wrote: Couldn't help myself. I had to write the Dragon Fractal in python.turtle :) That's nice. I ported it to use the pygsear Turtle class. http://www.nongnu.org/pygsear/ Nice. I still have to download a version of pygame to try this

Re: Max files in unix folder from PIL process

2005-03-28 Thread "Martin v. Löwis"
David Pratt wrote: Hi. I am creating a python application that uses PIL to generate thumbnails and sized images. It is beginning to look the volume of images will be large. This has got me to thinking. Is there a number that Unix can handle in a single directory. I am using FreeBSD4.x at the

Re: Max files in unix folder from PIL process

2005-03-28 Thread Andrew Dalke
Kane wrote: > I ran into a similar situation with a massive directory of PIL > generated images (around 10k). No problems on the filesystem/Python > side of things but other tools (most noteably 'ls') don't cope very > well. My experience suggests that 'ls' has a lousy sort routine or that it tak

Re: Module function can't see globals after import.

2005-03-28 Thread Ron_Adam
On Mon, 28 Mar 2005 20:46:32 +0300, Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> wrote: >On Mon, 28 Mar 2005 17:19:42 GMT, rumours say that Ron_Adam ><[EMAIL PROTECTED]> might have written: > >>Is there a way to tell the imported function printx to use mymain's >>globals instead of it's own co

Re: File Uploads

2005-03-28 Thread Doug Helm
Andrew: I'm a dope. You're brilliant. Thank you. That worked splendidly. Doug <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Doug Helm wrote: > > > form = cgi.FieldStorage() > > if lobjUp.Save('filename', 'SomeFile.jpg'): > > > class BLOB(staticobject.StaticObject): > > def

Crash in thread on program termination

2005-03-28 Thread Eric Ries
I just recently came across this post from the mailing list: http://mail.python.org/pipermail/python-list/2005-February/265569.html in which the error with daemon threads at interpreter shutdown is discussed. I have experienced this problem in numerous programs that I've written and wanted to wri

Re: Overriding methods in classes you don't control

2005-03-28 Thread Alex VanderWoude
"Jp Calderone" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Mon, 28 Mar 2005 03:57:16 GMT, Alex VanderWoude <[EMAIL PROTECTED]> wrote: > >Is there a way to override a method on a class whose source you cannot > > change in such a way that you can hook into that method's code? A

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "cjl" <[EMAIL PROTECTED]> wrote: > Hey all: > > I'm working on a 'pure' python port of some existing software. > > Implementations of what I'm trying to accomplish are available (open > source) in C++ and in Java. > > Which would be easier for me to use as a ref

Re: Max files in unix folder from PIL process

2005-03-28 Thread David Pratt
Hi Jason. Many thanks your reply. This is good to know about ls - what did it do? Was it just slow or did the server or machine die? My images will be going into the path of a web server. This is unchartered territory for me and I don't know whether there will be speed and access problems o

Re: hiding a frame in tkinter

2005-03-28 Thread Harlin Seritt
faramarz, Most likely, you'll need to replace the 'forgotten' frame with another one or other widget. You can immediately do *.pack() and it will replace the frame (assumming you haven't already packed something else there). Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: good IIS 6.0(win2k3) python CGI web ext. setup instructions

2005-03-28 Thread Harlin Seritt
Thanks Mark. Since you were in the spirit of volunteering some valuable information, I thought I'd put in my two cents worth. If you are thinking of using Zope or Python CGI for web apps, please take a look at CherryPy (http://www.cherrypy.org). If you are wanting to create a simple, intermediate

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: Patrick Useldinger wrote: cjl wrote: Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I'm not looking for automated tools, just trying to gather opinions on which language i

Re: author index for Python Cookbook 2?

2005-03-28 Thread Cappy2112
I'm pretty sure I saw your name in one of the recipes for the new book. Why not email Oreilly -- http://mail.python.org/mailman/listinfo/python-list

Re: The Greatest News Ever!

2005-03-28 Thread Lonnie Princehouse
I complained to blogger about this spammer earlier, and shortly after receiving the automated "Thanks for your feedback..." message, I got another message from Blogger support: > Hi there, > > Thanks for writing us regarding this possible Terms of Service > violation. We will examine it soon and

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread David Eppstein
In article <[EMAIL PROTECTED]>, Jack Diederich <[EMAIL PROTECTED]> wrote: > I only included making iter a type to make it more symmetric with str > being a type. iter is currently a function, as a practical matter I wouldn't > mind if it doubled as a namespace but that might make others flinch.

Re: Python Cookbook 2nd Ed

2005-03-28 Thread Terry Reedy
"Will McGugan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is the second edition of the Python Cookbook worth getting if you have > the first edition? How much new material is there in the 2nd edition? >From Page xx: 146 old, 192 new, 338 total. 1.52 to 2.2 versus 2.3 to 2.4

good IIS 6.0(win2k3) python CGI web ext. setup instructions

2005-03-28 Thread mark
Here is a good set of instructions for setting up web extenstions for python CGI on windows 2003 server... Not sure why anyone would want to use IIS but here they are none the less... http://python.markrowsoft.com/iiswse.asp Cheers, Mark -- http://mail.python.org/mailman/listinfo/python-li

Re: breaking up is hard to do

2005-03-28 Thread bbands
Cameron, Thanks for the heads up on that. (I have been following it, but from a long distance, as I very happy with my garden-variety Python.) Separately, let me offer you my thanks for your contributions to the community; they are great and they are much appreciated. The community around Python

Re: breaking up is hard to do

2005-03-28 Thread bbands
Thanks for your reply. That seems like an interesting and practical approach. However, I have one worry. In addition to the config file I am parsing command-line overrides to the config values via optparse. Many modules, classes and functions depend on these values, which means a lot of code dupli

Re: doing "checksum" in python

2005-03-28 Thread Sean Blakey
On 28 Mar 2005 15:11:32 -0800, GujuBoy <[EMAIL PROTECTED]> wrote: > is there a built-in function that does a "checksum" on a file...basicly > counts the bytes and computes a 16-bit checksum for each given FILE. > > this is the like the "sum" command in unix > > -- > http://mail.python.org/mailman

Re: doing "checksum" in python

2005-03-28 Thread Irmen de Jong
GujuBoy wrote: > is there a built-in function that does a "checksum" on a file...basicly > counts the bytes and computes a 16-bit checksum for each given FILE. > > this is the like the "sum" command in unix > Try zlib.adler32 or zlib.crc32 ...? >>> import zlib >>> zlib.crc32(open("c:\\boot.ini

RE: __getslice__ passed INT_MAX rather than sys.maxint for missingendpoint?

2005-03-28 Thread Delaney, Timothy C (Timothy)
Dave Huang wrote: > Hi, I don't actually know Python; I'm just trying to debug a problem > I encounted in another program, so apologies if this has been > covered before. I did do some Google searches though, and didn't > find anything that specifically addressed this :) > > According to the docu

Re: newbie question

2005-03-28 Thread Sean Blakey
On 28 Mar 2005 15:00:37 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > How do i create two memory mapped buffers(mmap) and pass an index to > select which one needs to be populated? > > Is it possible to define the size of the buffer? > > -SB > > -- > http://mail.python.org/ma

Re: Max files in unix folder from PIL process

2005-03-28 Thread Kane
I ran into a similar situation with a massive directory of PIL generated images (around 10k). No problems on the filesystem/Python side of things but other tools (most noteably 'ls') don't cope very well.As it happens my data has natural groups so I broke the big dir into subdirs to sidestep t

doing "checksum" in python

2005-03-28 Thread GujuBoy
is there a built-in function that does a "checksum" on a file...basicly counts the bytes and computes a 16-bit checksum for each given FILE. this is the like the "sum" command in unix -- http://mail.python.org/mailman/listinfo/python-list

RE: The Running Time of += on Char Strings ?

2005-03-28 Thread Delaney, Timothy C (Timothy)
MyHaz wrote: > ''.join(['Thank ','you]) ^^ Syntax error ... Probably better as: ' '.join(['Thank', 'you']) ;) Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

newbie question

2005-03-28 Thread shama . bell
Hello, How do i create two memory mapped buffers(mmap) and pass an index to select which one needs to be populated? Is it possible to define the size of the buffer? -SB -- http://mail.python.org/mailman/listinfo/python-list

author index for Python Cookbook 2?

2005-03-28 Thread Andrew Dalke
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew [EMAIL PROTECTED] -- http://mail.p

Re: DBAPI Paramstyle

2005-03-28 Thread Gerhard Haering
On Mon, Mar 28, 2005 at 01:43:28PM -0800, Andy Dustman wrote: > Tim Roberts wrote: > > [prepared statements] > > mx.ODBC does, since it is an ODBC implementation. I would be very > surprised if the Oracle adapter did not. MySQLdb does not yet, but > probably will by the end of summer (with MySQL-4

Status of Python implementation for PalmOS?

2005-03-28 Thread Wolfgang Keller
Hello, Does anyone have any recent information about the status of the (Stackless) Python implementation for the PalmOS? (Yes, I know about Pippy, but that's O-L-D) TIA, Best regards, Wolfgang Keller -- P.S.: My From-address is correct -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Cookbook, 2'nd. Edition is published

2005-03-28 Thread Trent Mick
> > I don't have my copy yet. Can you give any guidance on how the 2'nd > > edition compares to the 1'st edition? Here is an excerpt from the preface (typing errors are mine): If you already own the first edition, you may be wondering whether you need this second edition, too. We think th

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Kent Johnson
cjl wrote: Hey all: I'm working on a 'pure' python port of some existing software. Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I haven't touched C++ in a long time, my experience porting Java to

Looking for Stephen Turner, maintainer of informixdb

2005-03-28 Thread Carsten Haese
Hello everybody: I have discovered that the functionality for connecting Python to an Informix database is currently in a frustrating state of neglect. The link to Kinfxdb is dead, and informixdb doesn't build on Python 2. I couldn't find any usable workarounds to the build problem, so I worked ou

Re: how to apply "mvc" pattern to gui-design in python

2005-03-28 Thread Gustavo Rahal
Swaroop C H wrote: On Mon, 28 Mar 2005 17:26:14 +0800, Su Wei <[EMAIL PROTECTED]> wrote: i have a project want to develop with python. who can tell me that how to apply "mvc" pattern to gui-design in python. please give me some advices! ths in advanced. This may help you: http://pygtkmvc.sourcefo

Re: newbie question: how to get the class instance given a moduleobject?

2005-03-28 Thread Kent Johnson
Steven Bethard wrote: Tian wrote: import ModuleA classname = "Dog" module = globals()["ModuleA"] classobj = ??? <---using classname instanct = classobj() classobj = getattr(module, classname) There may not be any need for the indirect lookup of ModuleA, you can say classobj = getattr

Re: DBAPI Paramstyle

2005-03-28 Thread Andy Dustman
Tim Roberts wrote: > In theory, using a paramstyle allows the query to be sent to the SQL > database backend and compiled like a program. Then, successive uses of the > same query can be done by sending just the parameters, instead of sending > the entire query string to be parsed and compiled aga

(no subject)

2005-03-28 Thread python-list-bounces+archive=mail-archive . com
#! rnews 2354 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!in.100proofnews.com!in.100proofnews.com!newsread.com!news-xfer.newsread.com!nntp

using distutils.command.config

2005-03-28 Thread John Hunter
I am trying to utilize the config module in distutils to test for certain headers and libraries and fail elegantly if they are not found with a helpful message. The typical gcc error message when a header is missing is inscrutable to many. I have subclassed config and can use my class with >

Re: Python Cookbook, 2'nd. Edition is published

2005-03-28 Thread Larry Bates
Sorry, I didn't ever have copy of 1st edition. Maybe Alex can help us on this one? -Larry [EMAIL PROTECTED] wrote: > Hello Larry, > > I don't have my copy yet. Can you give any guidance on how the 2'nd > edition compares to the 1'st edition? At 844 pages, it seems to be 250+ > pages bigger than

Max files in unix folder from PIL process

2005-03-28 Thread David Pratt
Hi. I am creating a python application that uses PIL to generate thumbnails and sized images. It is beginning to look the volume of images will be large. This has got me to thinking. Is there a number that Unix can handle in a single directory. I am using FreeBSD4.x at the moment. I am thinki

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread [EMAIL PROTECTED]
Patrick Useldinger wrote: > cjl wrote: > > > Implementations of what I'm trying to accomplish are available (open > > source) in C++ and in Java. > > > > Which would be easier for me to use as a reference? > > > > I'm not looking for automated tools, just trying to gather opinions on > > which lan

The Greatest News Ever!

2005-03-28 Thread Ron_Grossi_039
http://www.jcil.blogspot.com << The Greatest News Ever! -- http://mail.python.org/mailman/listinfo/python-list

Re: PyParsing module or HTMLParser

2005-03-28 Thread EuGeNe
Lad wrote: I came across pyparsing module by Paul McGuire. It seems to be nice but I am not sure if it is the best for my need. I need to extract some text from html page. The text is in tables and a table can be inside another table. Is it better and easier to use the pyparsing module or HTMLpar

Re: convert user input to Decimal objects using eval()?

2005-03-28 Thread Swaroop C H
On Mon, 28 Mar 2005 12:03:24 -0500, Julian Hernandez Gomez <[EMAIL PROTECTED]> wrote: > is there a "easy way" to make eval() convert all floating numbers to Decimal > objects and return a Decimal? > eval('1.0001+0.111') --> convert each number to a Decimal object, > perform the sum and obta

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Patrick Useldinger
cjl wrote: Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I'm not looking for automated tools, just trying to gather opinions on which language is easier to understand / rewrite as python. Depends

Which is easier? Translating from C++ or from Java...

2005-03-28 Thread cjl
Hey all: I'm working on a 'pure' python port of some existing software. Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I'm not looking for automated tools, just trying to gather opinions on whi

Re: Python Cookbook 2nd Ed

2005-03-28 Thread Skip Montanaro
Will> Is the second edition of the Python Cookbook worth getting if you Will> have the first edition? How much new material is there in the 2nd Will> edition? While I have dived into it yet, I received a copy from O'Reilly last week. It's about twice the size of the first edition, and

Re: PyParsing module or HTMLParser

2005-03-28 Thread Bill Mill
On 28 Mar 2005 12:01:34 -0800, Lad <[EMAIL PROTECTED]> wrote: > I came across pyparsing module by Paul McGuire. It seems to be nice but > I am not sure if it is the best for my need. > I need to extract some text from html page. The text is in tables and a > table can be inside another table. > Is

Re: Python Cookbook, 2'nd. Edition is published

2005-03-28 Thread rdsteph
Hello Larry, I don't have my copy yet. Can you give any guidance on how the 2'nd edition compares to the 1'st edition? At 844 pages, it seems to be 250+ pages bigger than the 1'st Ed. How much of the book is new, and does it use the same chapter headings? Ron Stephens Someone else asked a similar

PyParsing module or HTMLParser

2005-03-28 Thread Lad
I came across pyparsing module by Paul McGuire. It seems to be nice but I am not sure if it is the best for my need. I need to extract some text from html page. The text is in tables and a table can be inside another table. Is it better and easier to use the pyparsing module or HTMLparser? Thank

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread Peter Otten
jfj wrote: > As for the case where the users of the library want to subclass, I don't > see a problem.  They know they must subclass from class XXX and so they > call XXX.__init__ to construct it. I was thinking of class Child(Father, Mother): pass where Father and Mother have a common bas

tkinter and textvariable option

2005-03-28 Thread max(01)*
hello everybody. i am a a bit of a newbie in python/tkinter,and i am experimenting a bit with widgets like checkbuttons. in python, you can create a checkbutton instance like this: self.tergicristalli = IntVar() self.b1 = Checkbutton(self.pulsanti_spunta) self.b1.configure( text = "Tergicr

Re: Save passwords in scripts

2005-03-28 Thread Paul Rubin
Florian Lindner <[EMAIL PROTECTED]> writes: > Can I find out the identity of the client (PID/UID) when using unix socket? Unix sockets have a feature called ancillary messages that lets you do that, but the Python socket module currently doesn't support the feature. There's an open sourceforge b

Re: Get document as normal text and not as binary data

2005-03-28 Thread Kent Johnson
Markus Franz wrote: Hi. I used urllib2 to load a html-document through http. But my problem is: The loaded contents are returned as binary data, that means that every character is displayed like lÀÃt, for example. How can I get the contents as normal text? My guess is the html is utf-8 encoded - y

Trouble with RC2

2005-03-28 Thread Do Re Mi chel La Si Do
Hi ! I have sevral problems with P4-RC2. Typical case, I have a script who run OK with P4 "standard" ; but, on a new install, with P4-RC2, I obtain : Traceback (most recent call last): File "C:\PONX\ponx.py", line 60, in ? import pdebug File "C:\PONX\pde

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, James Stroud <[EMAIL PROTECTED]> wrote: > Hello, > > I have strings represented as a combination of an alphabet (AGCT) and a an > operator "/", that signifies degeneracy. I want to split these strings into > lists of lists, where the degeneracies are members of

Re: String Splitter Brain Teaser

2005-03-28 Thread Doug Schwarz
In article <[EMAIL PROTECTED]>, James Stroud <[EMAIL PROTECTED]> wrote: > Hello, > > I have strings represented as a combination of an alphabet (AGCT) and a an > operator "/", that signifies degeneracy. I want to split these strings into > lists of lists, where the degeneracies are members of

Re: Python for a 10-14 years old?

2005-03-28 Thread Lee Harr
On 2005-03-27, Joal Heagney <[EMAIL PROTECTED]> wrote: > Couldn't help myself. I had to write the Dragon Fractal in python.turtle >:) > That's nice. I ported it to use the pygsear Turtle class. http://www.nongnu.org/pygsear/ --- Dragon.py 2005-03-27 08:48:13.0 -0500 +++ pDragon.py 200

convert user input to Decimal objects using eval()?

2005-03-28 Thread Julian Hernandez Gomez
Hi ! This is maybe a silly question, but... is there a "easy way" to make eval() convert all floating numbers to Decimal objects and return a Decimal? for example: eval('1.0001+0.111') --> convert each number to a Decimal object, perform the sum and obtain a Decimal object as a result

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread Robert Dick
jfj: > In the case of Parent diamond inheritance, super() can avoid calling > the __init__ of parent twice? How? Guido has a nice description of it: http://www.python.org/2.2.3/descrintro.html#cooperation. It linearizes the graph. Unfortunately, this means that super delegates to siblings. T

Re: String Splitter Brain Teaser

2005-03-28 Thread Bill Mill
> That is clearer. At this point, though, you don't need the enumerator any > more > (so you can avoid indexing each item): Good point. > > def xgen(s): > srciter = iter(s) > item = [srciter.next()] > for i in srciter: > if i == '/': > item.append(srciter.

Re: String Splitter Brain Teaser

2005-03-28 Thread Steven Bethard
Michael Spencer wrote: def xgen(s): srciter = iter(s) item = [srciter.next()] for i in srciter: if i == '/': item.append(srciter.next()) else: yield item item = [i] yield item Note that the generator-based solution doesn't generate

Re: Calling __init__ with multiple inheritance

2005-03-28 Thread jfj
Peter Otten wrote: jfj wrote: Peter Otten wrote: Here is an alternative approach that massages the initializer signatures a bit to work with super() in a multiple-inheritance environment: super(Father, self).__init__(p_father=p_father, **more) Is there any advantage using super in this cas

Re: String Splitter Brain Teaser

2005-03-28 Thread Michael Spencer
Bill Mill wrote: > [long genomes might justify a generator approach] That's a good point. I should have said: *If* you are going to put the items into a list anyway, then there is no point generating the list items individually. Michael Spencer wrote: >>[Bill's solution didn't work for multiple-

Re: Get document as normal text and not as binary data

2005-03-28 Thread Diez B. Roggisch
Addendum: If you give us the url you're fetching data from, we might be able to look at the delivered data ourselves. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: Get document as normal text and not as binary data

2005-03-28 Thread Diez B. Roggisch
Markus Franz wrote: > Diez B. Roggisch wrote: > >> You get what the server sends. That is always binary - either it _is_ a >> binary file, or maybe in an unknown encoding. > > And how can I convert those binary data to a "normal" string with > "normal" characters? There is no "normal" - it's ju

Re: Save passwords in scripts

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

Re: Pre-PEP: Dictionary accumulator methods

2005-03-28 Thread Michael Spencer
Jack Diederich wrote: On Sun, Mar 27, 2005 at 02:20:33PM -0700, Steven Bethard wrote: Michele Simionato wrote: I am surprised nobody suggested we put those two methods into a separate module (say dictutils or even UserDict) as functions: from dictutils import tally, listappend tally(mydict, key)

Re: Grouping code by indentation - feature or ******?

2005-03-28 Thread Javier Bezos
"Dennis Lee Bieber" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > > I don't think l[:5] + l[5:] = l is a handy property > > and to me is clearly counterintuitive. Further, [snipped in the reply] Please, don't remove parts of my post which are relevant to the discussion. I s

looped if's stop working

2005-03-28 Thread lotmr
After figuring out how to have a threaded frontend to pass varibles I've run into a problem. The 'quit' command works as long as issue it fast enough as soon as the if's start looping. If I wait about 5 seconds, the commands will close the frontend thread but leave the main loop running. This seems

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-28 Thread Jack Diederich
On Mon, Mar 28, 2005 at 10:28:29AM -0700, Steven Bethard wrote: > Jack Diederich wrote: > > > > itertools to iter transition, huh? I slipped that one in, I mentioned > > it to Raymond at PyCon and he didn't flinch. It would be nice not to > > have to sprinkle 'import itertools as it' in code. it

  1   2   >