Re: building Python: up arrow broken on SuSE Linux 8.2

2005-01-27 Thread Peter Otten
Erik Johnson wrote: > the Apple Python distribution the OP was asking about.  I now notice this > in the output of configure: > > checking for rl_pre_input_hook in -lreadline... no > checking for rl_completion_matches in -lreadline... no > > > My system has /lib/libreadline.so.4.3.   I guess it

Re: tkinter socket client ?

2005-01-27 Thread Tonino
great - thanks ;) Tonino -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread michele . simionato
Davor wrote: > Thanks, > > I do not hate OO - I just do not need it for the project size I'm > dealing with - and the project will eventually become open-source and > have additional developers - so I would prefer that we all stick to > "simple procedural" stuff rather than having to deal with a de

Re: python without OO

2005-01-27 Thread Timo Virkkala
Davor wrote: Timo Virkkala wrote: This guy has got to be a troll. No other way to understand. not really - it was not my intention at all - but it seems people get upset whenever this OO stuff is mentioned - and what I did not expect at all at this forum as I believed Python people should not be

Re: string.atoi and string.atol broken? [OT]

2005-01-27 Thread Peter Otten
Christos TZOTZIOY Georgiou wrote: >>> In current Greek hexadecimal is "ÎÎÏÎ" ("dekaexadikon"). I borrowed Guido's time machine to fix the above (hopefully) :-) >>The Latin part escaped me. > > By Latin I suppose you jokingly mean the Greek parts... :) I thought it was a well-known fact

Re: String Fomat Conversion

2005-01-27 Thread Dennis Benzinger
mcg wrote: > Investigating python day 1: > > Data in file: > x y > 1 2 > 3 4 > 5 6 > > > Want to read file into an array of pairs. > > in c: scanf("%d %d",&x,&y)---store x y in array, loop. > > How do I do this in python?? > In the actual application, the pairs are floating pt i.e. -1.

Re: python without OO

2005-01-27 Thread Timo Virkkala
[EMAIL PROTECTED] wrote: I think the OO way is slightly more obscure. It's obvious what x = reverse(x) does, but it is not clear unless you have the source code whether x.reverse() reverses x or if it returns a reversed list. If x.reverse() does the former, a disadvantage relative to the procedural

Re: String Fomat Conversion

2005-01-27 Thread Stephen Thorne
On Thu, 27 Jan 2005 00:02:45 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Stephen Thorne wrote: > > f = file('input', 'r') > > labels = f.readline() # consume the first line of the file. > > > > Easy Option: > > for line in f.readlines(): > > x, y = line.split() > > x = float(x) > > y =

Re: py2exe problem

2005-01-27 Thread Harald Massa
Thomas, > Would the above (include all encodings stuff by default) be a good > solution, or do you have other ideas? I assume a good solution would involve switching pythons default from "ASCII" to "UNICODE" :) But ... as far as py2exe is concerned, yeah, I think it would be helpfull to includ

Re: Which is faster?

2005-01-27 Thread Peter Otten
Aggelos I. Orfanakos wrote: > Any idea which of the following is faster? > > 'a/b/c/'[:-1] > > or > > 'a/b/c/'.rstrip('/') Don't ask for the speed, decide whether you want to transform "a/b/c" --> "a/b/c" "a/b/c//" --> "a/b/c" or "a/b/c" --> "a/b/" "a/b/c//" --> "a/b/c/" That is much more

Re: python without OO

2005-01-27 Thread Peter Maas
Terry Reedy schrieb: But if the class method syntax were manditory, there would be class and/or class hierarchy bloat due to the unlimited number of possible functions-of-a-float and large number of actual such functions that have been written. You are right. I'm not an OO purist, I just wanted

Re: Classical FP problem in python : Hamming problem

2005-01-27 Thread Nick Craig-Wood
Francis Girard <[EMAIL PROTECTED]> wrote: > Thank you Nick and Steven for the idea of a more generic imerge. You are welcome :-) [It came to me while walking the children to school!] [snip] > class IteratorDeiterator: >def __init__(self, iterator): > self._iterator = iterator.__iter__

Re: Inherting from object. Or not.

2005-01-27 Thread Nick Coghlan
Frans Englich wrote: On Wednesday 26 January 2005 21:24, M.E.Farmer wrote: Hello Frans, What you are seeing is a step on the path to unification of types and classes. I changed all base classes in my project to inherit object. There appears to be no reason to not do it, AFAICT. Exactly. My advice

Re: python memory blow out

2005-01-27 Thread Nick Coghlan
Simon Wittber wrote: Does anyone have ideas on why this is occuring, or how I might otherwise prevent memory blow out? The first thing to check is whether you might be accidentally keeping a reference to the result set alive somewhere. If that's not the case, then try to find out if the result se

Re: python without OO

2005-01-27 Thread Peter Maas
Davor schrieb: I browsed docs a bit today, and they also confirm what I have believed - that OO is totally secondary in Python. OO is not secondary in Python. It's secondary for you :) And Python leaves the choice to you. In fact, object/classes/metaclasses are nothing but *dictionaries with iden

Re: python without OO

2005-01-27 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Then why was C++ invented? What you have described can be done in C, Pascal, and Fortran 90, all of which are generally classified as procedural programming languages. As Lutz and Ascher say in "Learning Python", in object-based programming one can pass objects around, use

Re: python without OO

2005-01-27 Thread Nick Coghlan
Davor wrote: data structures > and > functions that operate on these data structures Eh? What do you think a class is? Py> data = range(10) Py> list.extend(data, range(5)) Py> list.sort(data) Py> print data [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9] The fact that data.extend(range(5)) and data.s

Re: python without OO

2005-01-27 Thread Peter Maas
[EMAIL PROTECTED] schrieb: Davor is right: even if you do not want to use it, the stuff is *there* and somebody in your team will. So definitely there is an audience of programmers that just do not have an use for all the sophistication and actually are penalized by it. No, because Python does not

Re: HAVE YOU HEARD THE GOOD NEWS!

2005-01-27 Thread Alex Hunsley
[EMAIL PROTECTED] wrote: Good News! Do you know how simple it is to go to Heaven after this life has ended? Some people believe that belonging to a local church, temple, mosque or synagogue will get them to Heaven. Others believe that water baptism, obeying the ten commandments or just being a good

Re: python without OO

2005-01-27 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: Furthermore, if in Python the algorithm for the reverse function applies to many kinds of objects, it just needs to be coded once, whereas a reverse method would have to provided for each class that uses it (perhaps through inheritance). Indeed, this is why Python not only

ANN: Tao Scripting Language 0.8.5 beta released!

2005-01-27 Thread Limin Fu
Dear all, I am glad to announce in this mailing list that the lastest version of a new scripting language has come out. Welcome to try it out. Comments are welcome. Suggestions are appreciated. === Here are some details: === Design Goals: 1. Simple and

Re: python without OO

2005-01-27 Thread michele . simionato
Peter Maas: >[EMAIL PROTECTED] schrieb: >> Davor is right: even if >> you do not want to use it, the stuff is *there* and somebody in your >> team will. So definitely there is an audience of programmers that just >> do not have an use for all the sophistication and actually are >> penalized by it.

Re: python module in webmin

2005-01-27 Thread moma
sam wrote: Hi, Had anyone written any python module for webmin? Since webmin is written in perl, but I want to write a python app/module used by webmin. If you know the detail of writing a python module for use in perl webmin, please drop me some guideline. Perhaps It is better off to find/writ

Re: subprocess.Popen() redirecting to TKinter or WXPython textwidget???

2005-01-27 Thread paul koelle
Ivo Woltring wrote: The output of mencoder is not readable with readlines (i tried it) because after the initial informational lines You don't get lines anymore (you get a linefeed but no newline) The prints are all on the same line (like a status line) something like Pos: 3,1s 96f ( 0%) 42f

tkinter: Can You Underline More Than 1 Char In A Menu Title

2005-01-27 Thread Tim Daneliuk
I am currently underling the first character of a menu title (to indicate its shortcut/accelerator key) like this: self.WildBtn = Menubutton(self.mBar, text=WILDMENU, underline=0, state=DISABLED) However, I intend to actually have two separate keys invoke this menu to have it behave differently

Re: how to pass attribute name via sys.argv

2005-01-27 Thread Wolfram Kraus
Felix Hebeler wrote: Hi all, I am doing some Python scripting for a while, but I'm not too deep into it yet. So I have a problem I can't solve. I need to call an object attribute: value = object.attrName[0] the problem is, that the attribute name can only be specified at runtime. So what I have is

Re: how to pass attribute name via sys.argv

2005-01-27 Thread Gilles Lenfant
Felix Hebeler a écrit : Hi all, I am doing some Python scripting for a while, but I'm not too deep into it yet. So I have a problem I can't solve. I need to call an object attribute: value = object.attrName[0] the problem is, that the attribute name can only be specified at runtime. So what I hav

Re: Please suggest on the book to follow

2005-01-27 Thread Satchidanand Haridas
Hi, Probably the best resources for learning Python are available online. Here are a few sites that you might find helpful: 1. http://byteofpython.info/ 2. http://www.diveintopython.org/ -- Writted by Mark Pilgrim, covers many advanced material. The site says /"Dive into Python"/ is a "Pyth

Re: redirect of standard output of jython to JTextArea

2005-01-27 Thread Jan Gregor
problem solved. in class: sys.stdout = StdOutRedirector(self) class StdOutRedirector: def __init__(self, console): self.console = console def write(self, data): #print >> sys.stderr, ">>%s<<" % data if data != '\n': # This is a sucky hack. Fix printRe

Point of Sale

2005-01-27 Thread Andreas Pauley
Hi, My company has given me a rather cool project: I have to provide them with an open-source python-based point-of-sale / cash register system that can integrate with their existing ERP backend. The project will include development to ensure that the features they require are included in the op

Re: Please suggest on the book to follow

2005-01-27 Thread Ola Natvig
santanu wrote: Hi all, I know a little python (not the OOP part) learnt by studying the online tutorial. Now I would like to learn it more thoroughly. I have access to 'Programming Python' which I liked (on flipping through the pages), but the problem is it deals only with version 2.0 of Phython. S

a question about boost.python

2005-01-27 Thread Li Daobing
I can't use .def(str(self)) I write a simple example, without `str', I can build it well, but with this one, I can't build //Rational.cpp #include #include using namespace std; using namespace boost::python; class Rational {}; ostream& operator<<(ostream& os, Rational r){ return os; } BOOST_P

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread Lucas Raab
As long as we are discussing cryptography, what's wrong with m2crypto? http://sandbox.rulemaker.net/ngps/m2/ Why not incorporate it into the standard distribution? Or, what about Andrew Kuchling's crypto toolkit? http://www.amk.ca/python/code/crypto.html Umm, is it just me or did we jus

Re: exclude binary files from os.walk

2005-01-27 Thread Mark McEahern
The OP wrote: > Is there an easy way to exclude binary files (I'm working on Windows XP) from the file list returned by os.walk()? Sure, piece of cake: #!/usr/bin/env python import os def textfiles(path): include = ('.txt', '.csv',) for root, dirs, files in os.walk(path): for name in

Re: import hook, overwrite import?

2005-01-27 Thread Steve Holden
Kartic wrote: Hi Torsten, If you want to use other methods to import (other than good ole file system), yes, you can create an importer class and register it as an importer module, that import will use to search and import. For example, it is possible to use zip imports (this functionality is alrea

redirect of standard output of jython to JTextArea

2005-01-27 Thread Jan Gregor
Hello I want to redirect output of jython's functions print and println to JTextArea component. Is it possible ? I tried this (swingConsole.textArea is instance): In my class self.printStream= MyPrintStream(System.out) System.setOut(self.printStream)

Re: Help With Python

2005-01-27 Thread Nick Vargish
"Matt" <[EMAIL PROTECTED]> writes: > Not to be nit-picky, but you got some issues here ;-). Never forget > the importance of "self"! Teach me to post untested code. *hangs head* Nick -- # sigmask || 0.2 || 20030107 || public domain || feed this to a python print reduce(lambda x,y:x+c

parsing WSDL

2005-01-27 Thread Alessandro Crugnola
Hi to all. Is there a way, maybe using 4suite, to read a wsdl file and find for every method all the input/output params and their type? -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > Some complexity is not needed, and I am sure even in Python > something could be dropped. But it is difficult to find what can > be removed. Remember that Saint-Exupery quote? Something > like "a work of art is finished when there is nothing left to remove?" Sa

Re: Python-list Digest, Vol 16, Issue 457

2005-01-27 Thread Eduardo Henriquez A.
On Thu, 27 Jan 2005 14:20:25 +0100 (CET), [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Send Python-list mailing list submissions to >python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, visit >http://mail.python.org/mailman/listinfo/python-list > or, via

Re: python without OO

2005-01-27 Thread Alex Martelli
PA <[EMAIL PROTECTED]> wrote: > Yes. But even with the "best" tool and the "best" intents, projects > still fail. In fact, most IT projects are considered failures: > > http://www.economist.com/business/PrinterFriendly.cfm?Story_ID=3423238 The main thesis of the article you quote (although it a

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread Skip Montanaro
>> Finally, what if, saints be preserved, your whizbang new module is phr> It is not a whizbang module. It is a stripped-down, basic phr> implementation of a well-accepted set of standards that are being phr> used in thousands of other applications in other languages. Then there

Re: python without OO

2005-01-27 Thread beliavsky
[EMAIL PROTECTED] wrote: > >> There is not much than can be done at the Python level. But I would > >> see with interest a Python spinoff geared towards simplicity. > > >I think this would be useless because advanced concepts exist for > >a reason. A simplified spin-off would aquire advanced conce

Re: Point of Sale

2005-01-27 Thread Peter Hansen
Andreas Pauley wrote: My company has given me a rather cool project: I have to provide them with an open-source python-based point-of-sale / cash register system that can integrate with their existing ERP backend. Do you have information about the interface to the ERP back end? It could be anythin

how to pass attribute name via sys.argv

2005-01-27 Thread Felix Hebeler
Hi all, I am doing some Python scripting for a while, but I'm not too deep into it yet. So I have a problem I can't solve. I need to call an object attribute: value = object.attrName[0] the problem is, that the attribute name can only be specified at runtime. So what I have is something like >>>

RE: Point of Sale

2005-01-27 Thread Gabriel Cosentino de Barros
Title: RE: Point of Sale Hi, i'm curently doing a POS. But mine is a small scale and stand alone. Are you planing on developing in house and then opening? develop at open or simple use open source tools and keep it closed? I'm going to post my progress at source forge next week when i finis

Re: Please suggest on the book to follow

2005-01-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fuzzyman <[EMAIL PROTECTED]> wrote: >We've only just had Python 2.4. Based on previous experience that means >it will be about 18 months before python 2.5. > >I learned to program from 'Programming Python'. Particularly the stuff >on Tkinter is very helpful. I do

Re: Point of Sale

2005-01-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Andreas Pauley <[EMAIL PROTECTED]> wrote: >Hi, > >My company has given me a rather cool project: >I have to provide them with an open-source python-based point-of-sale / >cash register system that can integrate with their existing ERP backend. > >The project will i

Re: Please suggest on the book to follow

2005-01-27 Thread Fuzzyman
We've only just had Python 2.4. Based on previous experience that means it will be about 18 months before python 2.5. I learned to program from 'Programming Python'. Particularly the stuff on Tkinter is very helpful. I don't think you'll have much to 'unlearn', although obviously there is stuf

Re: how to comment out a block of code

2005-01-27 Thread Duncan Booth
Xah Lee wrote: > > is there a syntax to comment out a block of code? i.e. like html's > or perhaps put a marker so that all lines from there on are ignored? > thanks. > The simplest way is to select the block of code in your editor and use the 'comment-region' command. If this doesn't work, u

Please suggest on the book to follow

2005-01-27 Thread santanu
Hi all, I know a little python (not the OOP part) learnt by studying the online tutorial. Now I would like to learn it more thoroughly. I have access to 'Programming Python' which I liked (on flipping through the pages), but the problem is it deals only with version 2.0 of Phython. So, I would

Re: python without OO

2005-01-27 Thread michele . simionato
> "Perfection is achieved, not when there is nothing more to add, but > when there is nothing left to take away." Thanks, that was it! ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
me> PQPython23 - the Lib implementation me> PQ0 - my insertion sort based variant me> PQueue - my "heap" based variant me> (like PQPython23, but different). Tim D: > First of all, you should be running these benchmarks using Python 2.4. > heapq is considerably faster there ... (Raymond Hettinger

Freeze with wxpython on python 2.3 or python 2.4 on Win32 with Thread

2005-01-27 Thread Tsubasa[Hokage]
Hello i have a problem with thread and wxpython on WIN32. With this script : I would like to SetValue to my gauge widget in a thread. I can GetValue without a hitch but if I SetValue it freezing. Try following script and go to AF-Tools Menu and click install Normally in the install thread, I wr

Re: Tao Scripting Language 0.8.5 beta released!

2005-01-27 Thread Claudio Grondi
Dear Limin, Tao Script with its 300 KByte of code is so small, that one just must love it forgiving all its baby troubles. After changes (see below) to the code in taoModule.cpp necessary because my compiler claimed repeated definition of 'ref' e.g. in the section: if(TaoReference *ref2a=inNameSp

Re: Please suggest on the book to follow

2005-01-27 Thread santanu
Thanks for the reply. >From your suggestions, I guess I would have no problems learning from Programming Python. I didn't like Core Python Programming and such books. I like to read cover to cover and the chapters on data structures and such elementary things put me to sleep. I already have an idea

python IIS cgi working but loading extremely slow

2005-01-27 Thread smartin
python IIS cgi loading extremely slow I recently uninstalled python 1.5.2 and installed python 2.3 on a Windows 2000 server running IIS 5.0. The issue is that when submitting a cgi request to a python script, it takes about 1 minute to process the python (2.3 code) and load the page on this partic

Re: Point of Sale

2005-01-27 Thread Andreas Pauley
On Thu, 27 Jan 2005, Cameron Laird wrote: In article <[EMAIL PROTECTED]>, Andreas Pauley <[EMAIL PROTECTED]> wrote: Hi, My company has given me a rather cool project: I have to provide them with an open-source python-based point-of-sale / cash register system that can integrate with their existin

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread Skip Montanaro
>> As long as we are discussing cryptography, what's wrong with m2crypto? >> Or, what about Andrew Kuchling's crypto toolkit? Lucas> Umm, is it just me or did we just discuss the legal issues of Lucas> that?? You may have. Whether or not there are legal issues with them is of lit

Re: Point of Sale

2005-01-27 Thread Andreas Pauley
On Thu, 27 Jan 2005, Peter Hansen wrote: Andreas Pauley wrote: My company has given me a rather cool project: I have to provide them with an open-source python-based point-of-sale / cash register system that can integrate with their existing ERP backend. Do you have information about the interfac

Re: Tao Scripting Language 0.8.5 beta released!

2005-01-27 Thread Limin Fu
Dear Claudio, Thank you for your kind testing, suggestions and encourages. I'm glad that you like it. For that problem in the Lexer, it can be corrected without increasing the size. I will do it soon. Best regards, Limin On Thu, 27 Jan 2005 15:32:13 -, Claudio Grondi <[EMAIL PROTECTED]>

Re: exclude binary files from os.walk

2005-01-27 Thread Alex Martelli
rbt <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > > On 2005-01-26, rbt <[EMAIL PROTECTED]> wrote: > > > >>Is there an easy way to exclude binary files (I'm working on > >>Windows XP) from the file list returned by os.walk()? > > > > Sure, assuming you can provide a rigorous definition of '

Re: exclude binary files from os.walk

2005-01-27 Thread Alex Martelli
Craig Ringer <[EMAIL PROTECTED]> wrote: > That's not really safe when dealing with utf-8 files though, and IIRC > with UCS2 or UCS4 as well. The Unicode BOM its self might (I'm not sure) > qualify as ASCII. Nope, both bytes in the BOM have the high-order bit set -- they're 0xFF and 0xFE -- so the

leo editor

2005-01-27 Thread Gabriel Cosentino de Barros
Title: leo editor A co-worker was trying to convince me that Leo[1] is the better editor of all since it outline the code and let you easily document algoritms and logic. He was writting php code with it. I use jEdit or vi to write my python and my php Then after a day of debates I ended up

Transparent (redirecting) proxy with BaseHTTPServer

2005-01-27 Thread paul koelle
Hi list, My ultimate goal is to have a small HTTP proxy which is able to show a message specific to clients name/ip/status then handle the original request normally either by redirecting the client, or acting as a proxy. I started with a modified[1] version of TinyHTTPProxy postet by Suzuki His

[ANN] Movable Python, linky and Techie Blog

2005-01-27 Thread fuzzyman
Minor news first : 'linky' a local link checker is available. http://www.voidspace.org.uk/python/programs.shtml#linky linky will check your website for dead links (within the website) as well as comparing it to the website on your filesystem, to check for case errors that might not be picked up i

Re: Help With Python

2005-01-27 Thread Nick Craig-Wood
Steven Bethard <[EMAIL PROTECTED]> wrote: > Nick Vargish wrote: > > # this is one viking making one order repeated 511 times. if you want > > # 511 vikings making seperate orders, you'll have to write a loop. > > No need to write a loop: > > py> class Viking(object): > ... def order(self)

Re: Inherting from object. Or not.

2005-01-27 Thread Nick Craig-Wood
Nick Coghlan <[EMAIL PROTECTED]> wrote: > Exactly. My advice is to use new-style classes unless you have a > reason not to (if you're inheriting from a builtin type, then there > is no need to inherit from object as well - the builtin types > already have the correct basic type). Except for Ex

Re: XOR on string

2005-01-27 Thread Nick Craig-Wood
Peter Hansen <[EMAIL PROTECTED]> wrote: > snacktime wrote: > > I need to calculate the lrc of a string using an exclusive or on each > > byte in the string. How would I do this in python? > > lrc == Linear Redundancy Check? or Longitudinal? Note that > such terms are not precisely defined...

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread phr
Skip Montanaro <[EMAIL PROTECTED]> writes: > phr> It is not a whizbang module. It is a stripped-down, basic > phr> implementation of a well-accepted set of standards that are being > phr> used in thousands of other applications in other languages. > > Then there should be a library al

Re: Tuple slices

2005-01-27 Thread jfj
Nick Coghlan wrote: 1. Applies only if you are making large slices, or a lot of slices with each containing at least 3 elements. A view can also *cost* memory, when it looks at a small piece of a large item. The view will keep the entire item alive, even though it needs only a small piece. Tha

Re: What's so funny? WAS Re: rotor replacement

2005-01-27 Thread phr
Skip Montanaro <[EMAIL PROTECTED]> writes: > >> As long as we are discussing cryptography, what's wrong with > >> m2crypto? Or, what about Andrew Kuchling's crypto toolkit? > > Lucas> Umm, is it just me or did we just discuss the legal issues of > Lucas> that?? > > You may have.

Re: Please suggest on the book to follow

2005-01-27 Thread phr
"santanu" <[EMAIL PROTECTED]> writes: > I know a little python (not the OOP part) learnt by studying the online > tutorial. Now I would like to learn it more thoroughly. I think there's supposed to be a new version of Python in a Nutshell coming. That's a more serious book than Learning Python. -

Re: Another scripting language implemented into Python itself?

2005-01-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Arthur <[EMAIL PROTECTED]> wrote: . . . >As long as we include the cost of treating adults as children, and >take it seriously as the kind of cost it is, I'm OK. > >I think Terry's point covers

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread Szabolcs Nagy
hello nice benchmarks some time ago i've also done some benchmarking i sorted 10 random int with differrent heap implementations, bisect module and with list.sort() I know that heaps are not for sorting, but i tested their performance with sorting back then. my results (sorting algo / time):

Re: how to pass attribute name via sys.argv

2005-01-27 Thread Felix Hebeler
Wolfram Kraus wrote: Felix Hebeler wrote: I need to call an object attribute: value = object.attrName[0] Use getattr: value = getattr(object, attrName)[0] HTH, Wolfram Thanks so much! Had I known earlier. Looks so easy... Now, why did I not find this in the online tutorial, the reference manua

Re: python without OO

2005-01-27 Thread Dave Benjamin
Davor wrote: Is it possible to write purely procedural code in Python, or the OO constructs in both language and supporting libraries have got so embedded that it's impossible to avoid them? Also, is anyone aware of any scripting language that could be considered as "Python minus OO stuff"? (As you

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
(re: http://xsdb.sourceforge.net/bench/pq3.py) nsz> ...bisect is not so fast for large data... Yes I know in theory the insertion sort approach should be bad for large enough values, but the weird thing is that if you mix inserts and deletes (with enough deletes) even 1M elements is not a large

Re: Point of Sale

2005-01-27 Thread Evan Simpson
Andreas Pauley wrote: If the network is down each POS station should still be able to function without interruption. At the moment the current POS system uses an inhouse developed message queing system to communicate with the ERP/Retail backend. A POS station submits each transaction (and other

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Hypothetical performance improvements are the root of all evil. > -- Bill Tutt (paraphrased) well, after this week, I'd say that Hypothetical performance limitations are the root of all evil. -- http://mail.python.org/mailman/listinfo/python-list

Entirely off-topic personal grumble unrelated to original poster (was: Point of Sale)

2005-01-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Andreas Pauley <[EMAIL PROTECTED]> wrote: . . . >Actually I just mean that I'm not looking for a 100% feature-fit, if I get >a 70% fit I'll jump in and develop the other 30%.

Re: Please suggest on the book to follow

2005-01-27 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, santanu <[EMAIL PROTECTED]> wrote: . . . >>From what you and Fyzzyman said, I guess when I am done with >Programming Python, graduating to the latest features would >be quite easy. Isn't it?

Re: parsing WSDL

2005-01-27 Thread Holger Duerer
> "Alessandro" == Alessandro Crugnola <[EMAIL PROTECTED]> writes: Alessandro> Is there a way, maybe using 4suite, to read a wsdl Alessandro> file and find for every method all the input/output Alessandro> params and their type? Have you had a look at the Python WS tools? They do h

RE: Tkinter vs wxPython

2005-01-27 Thread Gabriel Cosentino de Barros
Title: RE: Tkinter vs wxPython *warning* My very own opinions ahead. no flame intended. > Try them both out for an hour or two, and go with whichever > one "feels right".  You very likely won't be making a mistake. i did that for java+swing, python+tk, python+gtk, python+wxWindow and pytho

Re: ANN: Tao Scripting Language 0.8.5 beta released!

2005-01-27 Thread Rocco Moretti
Limin Fu wrote: Dear all, I am glad to announce in this mailing list that the lastest version of a new scripting language has come out. Since you chose to announce it in this mailing list/newsgroup, may I suggest that a comparison with Python is in order? Since it is a new scripting language, I'm

Another scripting language implemented into Python itself?

2005-01-27 Thread ajsiegel
Cameron writes: >Pronouns quickly overload me. On a reread of my post, me, we and they and I all sympathize. >f you're saying that there's hysteria >afoot, much of it about the harm that might come through use of >computers left unprotected from evildoers, well, yes, I'm with you. >Most peop

Re: python memory blow out

2005-01-27 Thread jfj
Stephen Thorne wrote: On Thu, 27 Jan 2005 09:08:59 +0800, Simon Wittber <[EMAIL PROTECTED]> wrote: According to the above post: a) If the allocation is > 256 bytes, call the system malloc. b) If the allocation is < 256, use its own malloc implementation, which allocates memory in 256 kB chunks and

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread Tim Peters
[EMAIL PROTECTED], on ] > Yes I know in theory the insertion sort approach should be bad for > large enough values, but the weird thing is that if you mix inserts and > deletes (with enough deletes) even 1M elements is not a large enough > value. Anyway,

Re: Question: "load"ing a shared object in python

2005-01-27 Thread Rick L. Ratzel
Pro Grammer <[EMAIL PROTECTED]> writes: > Hello, all, > I am not sure if this is the right place to ask, but could you kindly tell me > how to "load" a shared object (like libx.so) into python, so that the methods > in > the .so can be used? That too, given that the shared object was written in

Re: String Fomat Conversion

2005-01-27 Thread Steven Bethard
Stephen Thorne wrote: I did all I did in the name of clarity, considering the OP was on his first day with python. How I would actually write it would be: inputfile = file('input','r') inputfile.readline() data = [map(float, line.split()) for line in inputfile] Notice how you don't have to call ite

Re: Help With Python

2005-01-27 Thread Steven Bethard
Nick Craig-Wood wrote: Steven Bethard <[EMAIL PROTECTED]> wrote: py> orders = [Viking().order()] * 7 py> ', '.join(orders) 'Spam, Spam, Spam, Spam, Spam, Spam, Spam' Thats still one Viking making 7 orders surely? So you want this... orders = [ Viking().order() for _ in range(7) ] Right, right. Tha

Re: urllib and proxy

2005-01-27 Thread chris
This was helpful. After reading this, I realized you can also just add this atop whatever script imports urllib. Just add after "import urllib": # Disable proxy use. urllib.getproxies = lambda x = None: {} -Chris http://www.fetidcascade.com/ -- http://mail.python.org/mailman/listinfo/python-li

Re: Please suggest on the book to follow

2005-01-27 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > "santanu" <[EMAIL PROTECTED]> writes: > > I know a little python (not the OOP part) learnt by studying the online > > tutorial. Now I would like to learn it more thoroughly. > > I think there's supposed to be a new version of Python in a Nutshell Just a 2nd edition.

HTML Tree View with and

2005-01-27 Thread Gregor Horvath
Hi, Before I reinvent the wheel I`d like to ask if someone has done this before since I did not find an advice at Google. The goal is to create a dynamic Tree View in HTML. Say I have a data strucure like this: structList = {'Sun':{'Sun.1':['Sun1.1','Sun1.2'],'Sun.2':['Sun2.1','Sun2.2']},'Kupa':

Re: String Fomat Conversion

2005-01-27 Thread Alex Martelli
Steven Bethard <[EMAIL PROTECTED]> wrote: ... > Beware of mixing iterator methods and readline: _mixing_, yes. But -- starting the iteration after some other kind of reading (readline, or read(N), etc) -- is OK... > http://docs.python.org/lib/bltin-file-objects.html > > next( ) >

Re: On benchmarks, heaps, priority queues

2005-01-27 Thread aaronwmail-usenet
re http://xsdb.sourceforge.net/bench/pq3.py Tim Peters: > If you repair that, and > instrument mixBench() to keep track of queue size statistics, you'll > find that even at 100, the queue at the top of the loop never > exceeds 30 entries, and has a mean size less than 3. Aha. Now that is emb

Re: String Fomat Conversion

2005-01-27 Thread Steven Bethard
Alex Martelli wrote: Steven Bethard <[EMAIL PROTECTED]> wrote: ... Beware of mixing iterator methods and readline: [snip] I hope this concisely indicates that the problem (in today's current implementations) is only with switching FROM iteration TO other approaches to reading, and (if the file

Re: python without OO

2005-01-27 Thread Jeff Shannon
Davor wrote: so you get a nice program with separate data structures and functions that operate on these data structures, with modules as containers for both (again ideally separated). Very simple to do and maintain [...] Replace "modules" with "classes" in the above quote, and you have the very

Re: inherit without calling parent class constructor?

2005-01-27 Thread Christian Dieterich
On Dé Céadaoin, Ean 26, 2005, at 17:02 America/Chicago, Steven Bethard wrote: Just a note of clarification: The @deco syntax is called *decorator* syntax. Classes with a __get__ method are called *descriptors*. Okay, I think I get the idea. I didn't know about the @deco syntax, but it seems to b

Re: Classical FP problem in python : Hamming problem

2005-01-27 Thread Francis Girard
Le jeudi 27 Janvier 2005 10:30, Nick Craig-Wood a ÃcritÂ: > Francis Girard <[EMAIL PROTECTED]> wrote: > > Thank you Nick and Steven for the idea of a more generic imerge. > > You are welcome :-) [It came to me while walking the children to school!] > Sometimes fresh air and children purity is al

  1   2   >