Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
For a start, >>> 22002496167782427386022437441624938050682666541682 & 0xL 67560050L >>> so you could just do that at the end. But you don't really want to be carrying all that rubbish around, getting longer and longer each time around the loop. And let's further the translation into Python

Re: Feature request: sorting a list slice

2006-05-21 Thread John Machin
Context? The whole message asked for a new feature. Please tell me what context I should have supplied. -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs perl lines of code

2006-05-21 Thread George Sakkis
John Bokma wrote: > Funny though, how you have a problem with a thread that side steps to Perl > only for 4 or 5 postings, but have no problem with a hit & run post in 5 > groups to spamvertize a site. > > Have fun with the pondering btw. > > -- > John MexIT: http://

Re: Python - Web Display Technology

2006-05-21 Thread Ben Finney
[EMAIL PROTECTED] writes: > Flash is like a 2 MB download that works in almost *every* browser > out there. Except all the browsers on platforms Macromedia have not chosen to support. And no-one else can implement it on those platforms, except by guessing about the closed implementation specifica

Software Needs Philosophers

2006-05-21 Thread Xah Lee
Software Needs Philosophers by Steve Yegge, 2006-04-15. Software needs philosophers. This thought has been nagging at me for a year now, and recently it's been growing like a tumor. One that plenty of folks on the 'net would love to see kill me. People don't put much stock in philosophers these

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Thank you very much John, I missed the point to add the *and* to workaround the long result issue! I think I understand it now. I am timing the code once translated, so here are the results for the crc calculation function. I did expected a big gap, as this does a lot of lookups to the crc tab

Does anybody know how to install PythonMagick?

2006-05-21 Thread Konrad Koller
I downloaded PythonMagick-0.6.tar, but then...? The installation process is obviously not as usual and python.netcrewzackpymagick.html is totally outdated. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Software Needs Less Idiots

2006-05-21 Thread PofN
Xah Lee wrote: > Software needs philosophers. No, software neds less idiots. So please take your medication and change profession. -- http://mail.python.org/mailman/listinfo/python-list

Re: WTF? Printing unicode strings

2006-05-21 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > Learn something every day. I take it "646" is an alias for "ascii" (or vice > versa)? Usage of "646" as an alias for ASCII is primarily a Sun invention. When ASCII became an international standard, its standard number became ISO/IEC 646:1968. It's not *quite* the same a

Problem with odbc and Sql Server

2006-05-21 Thread Frank Millman
Hi all I have found a problem using MS Sql Server connecting via the odbc module from python-win32. I am liaising with Mark Hammond, and he is trying to help, but he is very busy, and I cannot be certain whether the problem originates with the odbc module, with the ODBC Driver, or with Sql Server

Embedding end extending /Carl

2006-05-21 Thread Carl
I have just started to look at Python's C API and the possibilities for embedding Python within another application. Where should I look for examples and documentation? I have already glanced through Python's documentation, but need more examples for guidance towards proficiency. Carl -- http

Re: PHP's openssl_sign() using M2Crypto?

2006-05-21 Thread KW
On 2006-05-20, KW wrote: > I'm trying to convert some PHP code using OpenSSL to Python and I'm stuck > on openssl_sign() which uses an RSA private key to compute a signature. I think basicly my question is: how do I extract the key from a private key in M2Crypto? Best regards, -- Konrad -- htt

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
Gonzalo wrote: """ I missed the point to add the *and* to workaround the long result issue! I think I understand it now. I am timing the code once translated, so here are the results for the crc calculation function. """ Yes, and both of us were missing the point that the "16" means 16 bits wide!

Re: Feature request: sorting a list slice

2006-05-21 Thread Steve Holden
Feature? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Love me, love my blog http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list

Re: File encoding strategy question

2006-05-21 Thread Dennis Benzinger
Andrew Robert schrieb: > Hi everyone, > > I am in the process of creating a file transmit/receiver program using > MQSeries. > > The way it works is through creation of an XML message. > > Elements within the XML message contain things such as file name, size, > and the file contents. > > The f

Re: Software Needs Philosophers

2006-05-21 Thread Mark Shelor
Xah Lee wrote: > Programming languages are religions. For a long while now I've been > mildly uncomfortable calling it “religion”, but I don't feel bad > about it anymore. They're similar enough. At the top of the language > religion is the language itself; it serves as the deity and the object >

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Alexander Kozlovsky <[EMAIL PROTECTED]> wrote: > Hello all! > I have small silly syntax suggestion () > > In many cases, keys in dictionary-like objects are strings, > and moreover - valid Python identifiers. Something like: > > foo["bar"]["baz"].x = y >

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Dan Sommers
On Sun, 21 May 2006 16:19:29 +0400, Alexander Kozlovsky <[EMAIL PROTECTED]> wrote: > How about small syntactic sugar: > foo!bar!baz.x = y > With this suggestion, mapping!identifier > becomes fully equivalent to mapping["identifier"] Take a look at the "Bunch" recipe in the Pyt

Re: misleading prefix ++

2006-05-21 Thread Carl Friedrich Bolz
Edward Elliott wrote: > Peter Otten wrote: [snip] > > Now that is absolutely lovely. Looks like it's time to join the ranks of > Perl and C with an Obfuscated Python Contest. ;) > yes, please! and you get special points for programs that seem to do one thing but do something totally entirely

Re: File encoding strategy question

2006-05-21 Thread John Machin
Andrew > I would like to be able to view the contents of the file if it is text while still maintaining the ability to transmit binary data. Like Dennis said ... and once you have read the RFC and understood it thoroughly :-) don't start writing code; it's one of the included batteries -- but bewa

Re: Using metaclasses to inherit class variables

2006-05-21 Thread [EMAIL PROTECTED]
If some one ever wants to build on this in the future, the current form and use is: import copy class ClassVars(type): classVars = dict(fields=[], longest=0) # adjust this def __init__(cls, name, bases, dict): for name, value in ClassVars.classVars.iteritems():

Re: Software Needs Philosophers

2006-05-21 Thread corff
In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> wrote: : the way through the Software Dark Ages we're in today: a time that will Wrong. We live in a paradise of ideas and possibilities well beyond the wildest dreams of only 20 years ago. : But I've failed. This isn't the essay I wanted to wr

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Alexander Kozlovsky
Roy Smith wrote: > Define a class (perhaps a subclass of dict, if you like) > with a __getattr__ method. Then you can just do > > foo.bar.baz.x = y > > with no changes needed to the language. I think, your solution is very error-prone. If such enhanced dictionary contains "keys" key, what is me

Re: Python - Web Display Technology

2006-05-21 Thread SamFeltus
I am in agreement that open standards are better. I also wish the open standards bodies would work more creatively, to bring us the most advanced standards, and not some echo of yesterdays technology. But, too me, saying No Flash is saying No Source if not Open Source. But, for me, it is better

Re: Using python for a CAD program

2006-05-21 Thread Mike C. Fletcher
[EMAIL PROTECTED] wrote: > Thanks for this. I'm enjoying this discussion and I'm learning a lot > about people's views and how they differ from mine. > > However, I'm still wondering about my original post. > > Can the experts please comment on python's usage for the following: > > 1. Databases.

Re: 'error reading datastream' -- loading file only when transfer is complete?

2006-05-21 Thread liuliuliu
thanks all. this seemed to work: import os stat = os.stat(str(newFiles[index])) size1 = stat.st_size pygame.time.wait(100) stat = os.stat(str(newFiles[index])) size2 = stat.st_size while

PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Heiko Wundram
Hi all! The following PEP tries to make the case for a slight unification of for statement and list comprehension syntax. Comments appreciated, including on the sample implementation. === PEP: xxx Title: Unification of for-statement and list-comprehension syntax Version: $Revision$ Last-Modifie

Re: Software Needs Philosophers

2006-05-21 Thread SamFeltus
Religious Fanaticism is a very strong in the Computer community. But, is it really a surprise that when a bunch of hairless apes created a new mental world, they created it with a complicated Quilt of religions and nationalities, and many became fanatical? I am confidant the responces Xah will re

Re: Software Needs Philosophers

2006-05-21 Thread Dražen Gemić
Xah Lee wrote: > Software Needs Philosophers > Welcome to my junk filters DG -- http://mail.python.org/mailman/listinfo/python-list

newbie: windows xp scripting

2006-05-21 Thread oscartheduck
I've been having trouble with the following style of script. It's simple stuff, I know, but it's stumping me: import os dirfrom = 'C:\\test' dirto = 'C:\\test1\\' copy_command = 'copy "%s" "%s"' % (dirfrom, dirto) if os.system(copy_command) == 0: print "yay" else: print "boo" What's g

Re: Does anybody know how to install PythonMagick?

2006-05-21 Thread oscartheduck
What distribution are you using? -- http://mail.python.org/mailman/listinfo/python-list

Re: Software Needs Philosophers

2006-05-21 Thread M Jared Finder
SamFeltus wrote: > Religious Fanaticism is a very strong in the Computer community. But, > is it really a surprise that when a bunch of hairless apes created a > new mental world, they created it with a complicated Quilt of religions > and nationalities, and many became fanatical? > > I am confid

Re: Software Needs Philosophers

2006-05-21 Thread Pascal Bourguignon
"SamFeltus" <[EMAIL PROTECTED]> writes: > Software needs philosophers is an interesting point, perhaps the most > important function of Philosophers is exposing Sacred Cows as just > Cattle. As I see it philosophers have a big problem: nobody need them, so they're out of job. That's why we see oc

Re: Feature request: sorting a list slice

2006-05-21 Thread Raymond Hettinger
Getting a patch ready for checkin (corrected, documented, reviewed, and tested) is only part of the battle. The real challenge of language design is figuring out whether something should be done. Adding optional parameters to a method makes its invocation slower and makes the API harder to learn

Re: newbie: windows xp scripting

2006-05-21 Thread Steve Holden
oscartheduck wrote: > I've been having trouble with the following style of script. It's > simple stuff, I know, but it's stumping me: > > import os > > dirfrom = 'C:\\test' > dirto = 'C:\\test1\\' > > copy_command = 'copy "%s" "%s"' % (dirfrom, dirto) > > if os.system(copy_command) == 0: >

Re: Feature request: sorting a list slice

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 18:55 schrieb Raymond Hettinger: > If the perf gain is small and the use cases are infrequent, the > addition is likely unwarranted. There is an entire class of feature > requests that are more appropriate as recipes than for inclusion in the > language. The thing is: havi

Re: Software Needs Philosophers

2006-05-21 Thread Ilias Lazaridis
Mark Shelor wrote: > Xah Lee wrote: > >> Programming languages are religions. For a long while now I've been ... ... > Is there really something new out there? I would argue that software > needs innovation more than it needs philosophers. software needs innovation. innovation needs philosoph

Re: Software Needs Philosophers

2006-05-21 Thread Tel A.
Xah, I agree with the thrust of your thread here, though I don't think it's anything special: people invest their values in what they invest their time in. To top it off, you're taking an anti-CL viewpoint in a group predominantly focused around CL (despite being named for just lisp). You're fight

escapes in regular expressions

2006-05-21 Thread James Thiele
I was helping a guy at work with regular expressions and found something I didn't expect: >>> re.match('\d', '7').group() '7' >>> re.match('\\d', '7').group() '7' >>> It's not clear to me why these are the same. Could someone please explain? -- http://mail.python.org/mailman/listinfo/python-lis

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread gangesmaster
i wanted to suggest this myself. +1 -tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Edward Elliott
Alexander Kozlovsky wrote: > With this suggestion, mapping!identifier > becomes fully equivalent to mapping["identifier"] Penny-wise, pound-foolish. Saves 3 character strokes at the cost of a new special-purpose operator which only works in limited circumstances. To avoid parsing

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread KW
On 2006-05-21, Heiko Wundram wrote: > Hi all! > > The following PEP tries to make the case for a slight unification of for > statement and list comprehension syntax. Sounds great! -- Konrad -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Felipe Almeida Lessa
Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu: > for node in tree if node.haschildren(): > > > as syntactic sugar for: > > for node in tree: > if not node.haschildren(): > continue > Today you can archive the same effect

Re: Software Needs Philosophers

2006-05-21 Thread Philippe Martin
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > This thought has been nagging at me for a year now, and recently it's > been growing like a tumor. One that plenty of folks on the 'net would > love to see kill me. > > People don'

Re: escapes in regular expressions

2006-05-21 Thread Dennis Benzinger
James Thiele schrieb: > I was helping a guy at work with regular expressions and found > something I didn't expect: > > re.match('\d', '7').group() > > '7' '\d' is not recognized as a escape sequence by Python and therefore it is left unchanged in t

Re: escapes in regular expressions

2006-05-21 Thread Paul McGuire
"James Thiele" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was helping a guy at work with regular expressions and found > something I didn't expect: > > >>> re.match('\d', '7').group() > '7' > >>> re.match('\\d', '7').group() > '7' > >>> > > It's not clear to me why these are th

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread gangesmaster
> Today you can archive the same effect (but not necessarily with the same > performance) with: > > for node in (x for x in tree if x.haschildren()): > true, but it has different semantic meanings -tomer -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Felipe Almeida Lessa
Em Dom, 2006-05-21 às 11:52 -0700, gangesmaster escreveu: > > Today you can archive the same effect (but not necessarily with the same > > performance) with: > > > > for node in (x for x in tree if x.haschildren()): > > > > true, but it has different semantic meanings > I know, that's also

Re: Feature request: sorting a list slice

2006-05-21 Thread Robert Kern
John Machin wrote: > Context? The whole message asked for a new feature. Please tell me what > context I should have supplied. When you reply to a message, please quote part of that message. That's what was meant by context. -- Robert Kern "I have come to believe that the whole world is an enig

proposal: disambiguating type

2006-05-21 Thread gangesmaster
typing "help(type)" gives the following documentation: >>> help(type) Help on class type in module __builtin__: class type(object) | type(object) -> the object's type | type(name, bases, dict) -> a new type "type" behaves both as a function, that reports the type of an obje

Re: Problem with odbc and Sql Server

2006-05-21 Thread Andrew MacIntyre
Frank Millman wrote: > Assume a table 't1' with a column 'c1' of type varchar(10). > >>From Python, set c1 to an empty string - > cur.execute("UPDATE t1 SET c1 = ?",['']) > > The result is that c1 is actually set to a string of 10 spaces. > > If I execute the command without using parameter

Re: Software Needs Philosophers

2006-05-21 Thread Burton Samograd
Pascal Bourguignon <[EMAIL PROTECTED]> writes: > "SamFeltus" <[EMAIL PROTECTED]> writes: >> Software needs philosophers is an interesting point, perhaps the most >> important function of Philosophers is exposing Sacred Cows as just >> Cattle. > > As I see it philosophers have a big problem: nobody

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Thank you for all the suggestions! :-) The C routine is almost -changing data type long for word- a copy of the function given by a hardware manufacturer, the same code used in their firmware to calc the checksum of every piece of data sent or received, and that data is somewhat special: it doe

Re: Programming language productivity

2006-05-21 Thread Peter Maas
John Bokma wrote: > Also note that Python programmers write more lines/hour which they need to > finish in the same time as Perl programmers :-D. You probably want to say that a Python program tends to have more lines than an equivalent Perl program. I think that a LOC comparison between a langu

Re: newbie: windows xp scripting

2006-05-21 Thread oscartheduck
It wasn't, but after seeing your success I discovered what was wrong. My destination directory didn't exist, and for some reason windows wasn't automatically creating it to dump the files in. I could fix this with a nested if statement, but it "feels" like windows should be creating this folder au

Re: Does anybody know how to install PythonMagick?

2006-05-21 Thread piotr maliński
python imaging library is more advanced and up to date :) try using this one. -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: windows xp scripting

2006-05-21 Thread oscartheduck
It wasn't, but after seeing your success I discovered what was wrong. My destination directory didn't exist, and for some reason windows wasn't automatically creating it to dump the files in. I could fix this with a nested if statement, but it "feels" like windows should be creating this folder au

Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Charles D Hixson
I was reading through old messages in the list and came up against an idea that I thought might be of some value: "Wouldn't it be a good idea if one could "rewind" an iterator?" Not stated in precisely those terms, perhaps, but that's the way I read it. I appreciate that one could use a sequence r

getattr for modules not classes

2006-05-21 Thread Daniel Nogradi
Is there something analogous to __getattr__ for modules? I know how to create a class that has attributes from a list and nothing else by overloading __getattr__ and making sure that the accessed attribute appears in my list. Now I would like to do the same with a module, say x.py, in which I have

Re: newbie: windows xp scripting

2006-05-21 Thread oscartheduck
For completeness' sake, this is the new script I came up with: import os dirfrom = 'C:\\test' dirto = 'C:\\test1\\' makedir = 'mkdir "%s"' % dirto copy_command = 'copy "%s" "%s"' % (dirfrom, dirto) if os.system(copy_command) == 0: print "yay" else: if os.system(makedir) == 0: if

Re: Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:43 schrieb Charles D Hixson: > I was reading through old messages in the list and came up against an > idea that I thought might be of some value: > "Wouldn't it be a good idea if one could "rewind" an iterator?" > Not stated in precisely those terms, perhaps, but that's t

Re: proposal: disambiguating type

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:13 schrieb gangesmaster: > i suggest splitting this overloaded meaning into two separate builtins: > * type(name, bases, dict) - a factory for types > * typeof(obj) - returns the type of the object While I personally don't find this proposal to be bad, this is something t

Re: Using python for a CAD program

2006-05-21 Thread baalbek
David Cuthbert wrote: > Some kind of transactionality is needed for undo/redo, but this is > usually done in a different (some might say "more efficient", others > might say "hackier") method than how transactions are implemented for > RDBMS (that I've dealt with, anyway). I suspect this can be

Re: getattr for modules not classes

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 21:52 schrieb Daniel Nogradi: > Is there something analogous to __getattr__ for modules? > > I know how to create a class that has attributes from a list and > nothing else by overloading __getattr__ and making sure that the > accessed attribute appears in my list. Now I woul

Slicing Issues

2006-05-21 Thread BJ Swope
Given this set of data (88 characters wide) in a file... 067AARON WAY   3004300252599A  098   067017  129 672 067ABBA CT 30518000882000902A  025  11   0670163227  365 670 067ABBEY HILL RD   3002400010299A  004

Re: escapes in regular expressions

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 19:49 schrieb James Thiele: > >>> re.match('\d', '7').group() >>> print '\d' \d > >>> re.match('\\d', '7').group() >>> print '\\d' \d '\d' evaluates to \d, because d is not a valid escape sequence. '\n' evaluates to newline, because n is a valid escape sequence. '\\' eva

Re: Slicing Issues

2006-05-21 Thread Heiko Wundram
Am Sonntag 21 Mai 2006 22:52 schrieb BJ Swope: > district_combo=line[85:3] This returns the slice from character 85 to character 3 in the string, read forwards. Basically, as Python slices are forgiving (because the borders are actually "illogical"), this amounts to nothing, but could also a

dynamic drawing in web page

2006-05-21 Thread barbaros
Hello everybody, I need to put some dynamic drawings on my web page. More precisely, I need to draw a number of geometric figures (circles, rectangles) which evolve into a graphics windows according to some law (a little bit like the solar system). I need also to have several fields aside the wind

Re: Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Edward Elliott
Heiko Wundram wrote: > But, think of the following: what if the iterator computes the values at > runtime, and you're not iterating over a "predefined" list of some sort? > Do you want the machinery to store the state of the iterator at every > earlier point in time (sometimes this may not even be

Re: Python - Web Display Technology

2006-05-21 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > None of you seem to know what you are talking about. That's not a way to make friends. I very well know what I'm talking about. None of the issues I've raised are negated by what you say, so every single one still stands. > Flash also behaves consistently

Re: Slicing Issues

2006-05-21 Thread BJ Swope
On 5/21/06, Heiko Wundram <[EMAIL PROTECTED]> wrote: Am Sonntag 21 Mai 2006 22:52 schrieb BJ Swope:> district_combo=line[85:3]This returns the slice from character 85 to character 3 in the string, readforwards. Basically, as Python slices are forgiving (because the borders are actually "illogic

Re: Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Roy Smith
Edward Elliott <[EMAIL PROTECTED]> wrote: > This is why the C++ STL has independent forward and backward iterator types. Let me see if I can paraphrase the difference between the Python design philosophy and the C++ design philosophy about most things. Python says, "Let's make things simple eno

Re: Question about Python on Mac

2006-05-21 Thread elventear
James Stroud wrote: > I think fink is not detecting the gmp (GNU multiple precision arithmetic > library) dependency. > > Try: > > % fink install gmp > > Then try building gmpy with /sw/bin/python. I think I didn't explain myself very well. gmp is already installed in my computer; when building gm

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread George Sakkis
Felipe Almeida Lessa wrote: > Em Dom, 2006-05-21 às 11:52 -0700, gangesmaster escreveu: > > > Today you can archive the same effect (but not necessarily with the same > > > performance) with: > > > > > > for node in (x for x in tree if x.haschildren()): > > > > > > > true, but it has differen

Re: Python - Web Display Technology

2006-05-21 Thread Roel Schroeven
SamFeltus schreef: > Here is a visual argument, I would love to see a list of AJAX and SVG > sites that display excellent graphics. > http://bacardimojito.com/main.swf > http://tokyoplastic.com/LF.swf > http://coolbreathpower.com/ > http://www.peterjoel.com/flash8previews/candleFlame.html > http://

Re: Programming language productivity

2006-05-21 Thread Edward Elliott
Peter Maas wrote: > I think that a LOC comparison between a language that enforces line breaks > and another language that enables putting an lots of code in one line > doesn't make much sense. I wonder why comparisons aren't made in terms of > word count. Word count would include literals, consta

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread John Machin
On 22/05/2006 5:22 AM, Gonzalo Monzón wrote: > Thank you for all the suggestions! :-) > > The C routine is almost -changing data type long for word- a copy of the > function given by a hardware manufacturer, the same code used in their > firmware to calc the checksum of every piece of data sent

Re: Slicing Issues

2006-05-21 Thread Paul McGuire
"Heiko Wundram" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Am Sonntag 21 Mai 2006 22:52 schrieb BJ Swope: > > district_combo=line[85:3] > > This returns the slice from character 85 to character 3 in the string, read > forwards. Basically, as Python slices are forgiving (becau

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Edward Elliott
George Sakkis wrote: > Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu: >> for node in tree if node.haschildren(): >> >> >> as syntactic sugar for: >> >> for node in tree: >> if not node.haschildren(): >> continue >> [snip] > > 2) "There should be one and preferably only one way to d

Re: Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Edward Elliott
Roy Smith wrote: > Edward Elliott <[EMAIL PROTECTED]> wrote: >> This is why the C++ STL has independent forward and backward iterator >> types. > > Let me see if I can paraphrase the difference between the Python design > philosophy and the C++ design philosophy about most things. Python says, >

Re: Name conflict in class hierarchy

2006-05-21 Thread Scott David Daniels
Jeffrey Barish wrote: > Suppose that there are two classes defined as follows: > > class A(object): > def f1(self): > print 'In A.f1, calling func' > self.func() > > def func(self): > print 'In A.func' > > class B(A): > def func(self): > print 'In B.fu

Re: Iterators: Would "rewind" be a good idea?

2006-05-21 Thread Diez B. Roggisch
> My knowledge of Python's iterators is kind of sketchy, so I may have missed > something. The only thing a python iterator really is is something that supports a next()-method and will raise a StopIteration-Exception in case of exhaustion. So - nobody stops you from introducing an object like

performance difference between OSx and Windows

2006-05-21 Thread Brian
I have been a Mac and linux guy since 1998 and except for a handful of times, have not touched a MS box since then. This changes a few days ago when I needed to get a MS box for another project. This leads me to my question... A while ago, I borrowed a python script from someone's blog that show

Re: WeakrefValueDictionary of Callables?

2006-05-21 Thread Lloyd Weehuizen
Thanks for that, I had a feeling that was the problem. Is there anyway around this? I'd prefer not to have to assume the method name on the object. This could be solved by passing the object and method name in as two separate parameters to the Bind function. But ideally I'd like to extract thi

Re: Python - Web Display Technology

2006-05-21 Thread Edward Elliott
[EMAIL PROTECTED] wrote: > Flash also behaves consistently cross-browser, cross/platform -- and > features cannot be disabled by the user. ^^ And that's a good thing? Maybe for Macromedia, not for us. This smells like astroturf. > Flash can load and play

Re: Python - Web Display Technology

2006-05-21 Thread Edward Elliott
Roel Schroeven wrote: > SamFeltus schreef: >> Here is a visual argument, I would love to see a list of AJAX and SVG >> sites that display excellent graphics. [snip] > > In my humble opinion, those sites are an argument _against_ the use of > Flash on websites. They may look pretty (I don't think

Re: Python - Web Display Technology

2006-05-21 Thread SamFeltus
Hmmm... It is interesting how something is terrible to one person, and great to another, and vice versa. I keep trying to understand why people like HTML/JS, I don't think I am gonna understand. I guess for better or worse, Flash is a very different mindset and approach to the web. Oh well, I l

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-21 Thread Jim Lewis
> and change "-lmsvcrt" to "-lmsvcr71". But then I get this error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. I want to use mingw. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Carl Banks
Heiko Wundram wrote: > The following PEP tries to make the case for a slight unification of for > statement and list comprehension syntax. -1 Adds complexity to the language and saves you nothing but an indent level. However, I encourage you to submit this PEP and get a (almost certianly negativ

Re: dynamic drawing in web page

2006-05-21 Thread Rhino
"barbaros" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello everybody, > > I need to put some dynamic drawings on my web page. More precisely, I > need to draw a number of geometric figures (circles, rectangles) which > evolve into a graphics windows according to some law (a li

Re: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-21 Thread Carl Banks
Edward Elliott wrote: > Special cases aren't special enough to break the rules. (proposal eliminates > the current special case for comprehensions/generators) It really isn't a special case, though. It might seem like it is, but it's not at all when you remember the rules of equivalence between l

Re: python vs perl lines of code

2006-05-21 Thread John Bokma
"George Sakkis" <[EMAIL PROTECTED]> wrote: > Oh, I think I get it now. Spamvertizing _one_ site is worth your > host's subscription; doing it for _four_ sites at your signature is > perfectly ok though. Do yourself and many others a favour before you post again, educate yourself on Usenet. It mi

Re: Programming language productivity

2006-05-21 Thread John Bokma
Peter Maas <[EMAIL PROTECTED]> wrote: > John Bokma wrote: >> Also note that Python programmers write more lines/hour which they >> need to finish in the same time as Perl programmers :-D. > > You probably want to say that a Python program tends to have more > lines than an equivalent Perl program

Re: Python - Web Display Technology

2006-05-21 Thread Luis M. González
IMHO, there's nothing more annoying that a website showing me a progression bar, indicating how much time it will get to provide the information I'm looking for... And when the progression bar ends, I have to wait until the flashy graphics and stupid presentation shows me the "go to html site"...

Re: dynamic drawing in web page

2006-05-21 Thread Paul Boddie
barbaros wrote: > > I need to put some dynamic drawings on my web page. More precisely, I > need to draw a number of geometric figures (circles, rectangles) which > evolve into a graphics windows according to some law (a little bit like > the solar system). I need also to have several fields aside

Re: Python - Web Display Technology

2006-05-21 Thread Ben Finney
"SamFeltus" <[EMAIL PROTECTED]> writes: > I keep trying to understand why people like HTML/JS, I don't think I > am gonna understand. It's fairly simple: HTML, CSS and JavaScript have all been standardised independent of any single corporation, and are freely implementable, resulting in competing

Re: performance difference between OSx and Windows

2006-05-21 Thread Avizoa
Brian wrote: > I have been a Mac and linux guy since 1998 and except for a handful of > times, have not touched a MS box since then. This changes a few days > ago when I needed to get a MS box for another project. This leads me > to my question... > > A while ago, I borrowed a python script from

Re: Software Needs Philosophers

2006-05-21 Thread nikie
Xah Lee wrote: > Software Needs Philosophers > > by Steve Yegge, 2006-04-15. > > Software needs philosophers. > > This thought has been nagging at me for a year now, and recently it's > been growing like a tumor. One that plenty of folks on the 'net would > love to see kill me. No, we all wish yo

Re: Python update trouble (2.3 to 2.4): x<

2006-05-21 Thread Gonzalo Monzón
Hi John! John Machin escribió: >On 22/05/2006 5:22 AM, Gonzalo Monzón wrote: > > >>Thank you for all the suggestions! :-) >> >>The C routine is almost -changing data type long for word- a copy of the >>function given by a hardware manufacturer, the same code used in their >>firmware to calc t

Python source sensitive to PyObject_HEAD layout?

2006-05-21 Thread Petter Haggholm
For academic reasons, I'm hacking on the Python source trying to add some new capabilities. At present, I'm making minor changes mostly to familiarise myself with the code and gain awareness of what issues I may encounter, with the result that I encountered a fairly strange one (to me, anyway). As

  1   2   >