Re: General Hash Functions In Python

2006-07-17 Thread Arash Partow
Hi Paul, For different data types different hash functions work better/worse aka fewer or more collisions. I believe the more choice people have and also the more ways people see how a particular thing can be done, then the easier it will be for them to come up with their own specific efficient s

Re: General Hash Functions In Python

2006-07-17 Thread Paul Rubin
"Arash Partow" <[EMAIL PROTECTED]> writes: > For different data types different hash functions work > better/worse aka fewer or more collisions. But you give no indication of which of those hashes works best for what kind of data. How is the user supposed to figure out which one to choose? -- ht

Re: General Hash Functions In Python

2006-07-17 Thread Robert Kern
Arash Partow wrote: > That said, I believe at least one (most likely more) of > the hash functions in the group above will most always work > better (ala less collisions) than the standard default hash > available in the built-in dict for any random set of strings. > > Please feel free to prove me

Re: embedding executable code in a regular expression in Python

2006-07-17 Thread Paul McGuire
Avi Kak wrote: > Folks, > > Does regular expression processing in Python allow for executable > code to be embedded inside a regular expression? > > For example, in Perl the following two statements > > $regex = qr/hello(?{print "saw hello\n"})mello(?{print "saw > mello\n"})/; > "jellohellomello"

Re: Augument assignment versus regular assignment

2006-07-17 Thread Antoon Pardon
On 2006-07-14, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: > >>AP> Well I'll start on an possitive note and accept this. Now I'd like you >>AP> to answer some questions. > >>AP> 1) Do you think the langauge reference makes it clear that this is h

Re: Augument assignment versus regular assignment

2006-07-17 Thread Antoon Pardon
On 2006-07-15, Terry Reedy <[EMAIL PROTECTED]> wrote: > The problem with understanding augmented assignment is that it directs the > compiler and interpreter to do one or maybe two mostly invisible > optimizations. To me, the effective meaning of 'evalutating once versus > twice' is most easil

Re: What is a type error?

2006-07-17 Thread Joachim Durchholz
Marshall schrieb: > Joachim Durchholz wrote: >> Marshall schrieb: >>> Good point. Perhaps I should have said "relational algebra + >>> variables with assignment." It is interesting to consider >>> assignment vs. the more restricted update operators: insert, >>> update, delete. >> Actually I see it

Re: What is a type error?

2006-07-17 Thread Rob Warnock
Joachim Durchholz <[EMAIL PROTECTED]> wrote: +--- | INSERT cannot be expressed in terms of assignment. INSERT creates a new | record; there's no way that assignment in a language like C can create a | new data structure! The same goes for DELETE. +--- Well, what about "

Re: What is a type error?

2006-07-17 Thread Joachim Durchholz
Chris Smith schrieb: > David Hopwood <[EMAIL PROTECTED]> wrote: >> Chris Smith wrote: >>> If checked by execution, yes. In which case, I am trying to get my head >>> around how it's any more true to say that functional languages are >>> compilable postconditions than to say the same of imperativ

Re: IDLE built-in help in Linux vs Windows

2006-07-17 Thread Tal Einat
Paul Rubin wrote: > In Windows if you click the Help dropdown, IDLE launches a help window > as it should. The help contents are included in the installation. > > In Linux, clicking Help launches a web browser, which is a perfectly > good UI for viewing help. However, instead of loading a static

Re: Augument assignment versus regular assignment

2006-07-17 Thread Paul Boddie
Antoon Pardon wrote: > > What the language reference should have said IMO is that in case x > is an attribute reference, index or slicing, the primary expression > will be evaluated only once, as will be the index or slice in the > two latter cases. I think the difficulty here for the author of th

Re: General Hash Functions In Python

2006-07-17 Thread Arash Partow
Trial and error - how else? :) I believe finding a perfect hash function for every kind and combination of data is a very very time consuming operation. Also there is the common case where the data is online (ie: stateless) that said it doesn't mean you can't make assumptions about the kind of dat

Re: General Hash Functions In Python

2006-07-17 Thread Arash Partow
That is true, but I'm not about to do something that might potentially prove my point wrong... :) Arash Partow Be one who knows what they don't know, Instead of being one who knows not what they don't know, Thinking they know everything ab

Re: General Hash Functions In Python

2006-07-17 Thread Stefan Behnel
Arash Partow wrote: > I've ported various hash functions to python if anyone is interested: > [snip] Ok, so if you think they are useful, what about writing up an article for the Python Cookbook that describes their usage and specific advantages/disadvantages? http://aspn.activestate.com/ASPN/Py

Re: Problem with "&" charater in xml.

2006-07-17 Thread Stefan Behnel
Kirt wrote: > i have walked a directory and have written the foll xml document. > one of the folder had "&" character so i replaced it by "&" > #--test1.xml > > C:\Documents and Settings\Administrator\Desktop\1\bye > w&y > [...] > #---

Re: What is a type error?

2006-07-17 Thread Joachim Durchholz
Rob Warnock schrieb: > Joachim Durchholz <[EMAIL PROTECTED]> wrote: > +--- > | INSERT cannot be expressed in terms of assignment. INSERT creates a new > | record; there's no way that assignment in a language like C can create a > | new data structure! The same goes for DELETE. > +--

Re: time.clock()

2006-07-17 Thread Nick Craig-Wood
Benjamin Niemann <[EMAIL PROTECTED]> wrote: > Tobiah wrote: > > On Unix... > What you want sound like the 'wall clock' time. The CPU time is the time > that the CPU spent on executing your process. And unless the process uses > 100% of the CPU, CPU time will appear to be 'slower' than the wall

Re: Python strings outside the 128 range

2006-07-17 Thread Michael Piotrowski
On 2006-07-14 "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Sybren Stuvel schrieb: >> Diez B. Roggisch enlightened us with: >>> Of course not. AFAIK there is no way figuring out which encoding the >>> target console supports. The best you can do is to offer an option >>> that allwos selection of

Help with a command line interface program, where do I start?

2006-07-17 Thread Kusanagi
Help with a command line interface program, where do I start? Hi Everybody,       I am a little new with python, so please forgive any of my mistakes. I need a little help with setting up a command line program that is to be run from a cmd prompt, I don't even know where to start. I have b

Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
My Tkinter application has to receive events from a TCP connection. I have chosen to do this in the following manner: The TCP communication takes place in a separate thread. When I receive data, I generate an event in the Python application thus: app.event_generate("<>") In the associated ev

Re: General Hash Functions In Python

2006-07-17 Thread John Machin
On 17/07/2006 5:52 PM, Arash Partow wrote: > Hi Paul, > > For different data types different hash functions work > better/worse aka fewer or more collisions. > > I believe the more choice people have and also the more > ways people see how a particular thing can be done, then > the easier it will

Re: Problems with Tkinter and threads

2006-07-17 Thread Paul Rubin
"Claus Tondering" <[EMAIL PROTECTED]> writes: > The TCP communication takes place in a separate thread. When I receive > data, I generate an event in the Python application thus: > > app.event_generate("<>") I think all bets are off when you do that. Tkinter is simply not thread safe and gen

Re: Embedding exe file

2006-07-17 Thread Bayazee
hi,ThanX but i dont want to save the exe file in temp file and run it . i want to run it directly from python . maybe such this : exec("file("test.exe","rw").read())") i want write a cd lock with python tp protect an binary file . and so i dont want save it in other temp file fom max security

Re: compiling 2.3.5 on ubuntu

2006-07-17 Thread Steve Holden
Justin Azoff wrote: > Py PY wrote: > >>(Apologies if this appears twice. I posted it yesterday and it was held >>due to a 'suspicious header') >> >>I'm having a hard time trying to get a couple of tests to pass when >>compling Python 2.3.5 on Ubuntu Server Edition 6.06 LTS. I'm sure it's >>not too

Re: Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
Paul Rubin wrote: > Tkinter is simply not > thread safe and generating events from another thread can trigger race > conditions and who knows. Does this mean that I cannot even call the main thread's after_idle method from another thread? -- Claus Tondering -- http://mail.python.org/mailman/lis

Re: Python strings outside the 128 range

2006-07-17 Thread Piet van Oostrum
> Michael Piotrowski <[EMAIL PROTECTED]> (MP) wrote: >MP> On 2006-07-14 "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >>> Sybren Stuvel schrieb: Diez B. Roggisch enlightened us with: > Of course not. AFAIK there is no way figuring out which encoding the > target console supports.

Re: Problems with Tkinter and threads

2006-07-17 Thread Paul Rubin
"Claus Tondering" <[EMAIL PROTECTED]> writes: > Does this mean that I cannot even call the main thread's after_idle > method from another thread? I'm not certain, I've never tried it that way since there's no way I could be confident of its reliability even if it appeared to work. Just use after_i

Re: EuroPython 2006 and Py3.0

2006-07-17 Thread Steve Holden
Nick Vatamaniuc wrote: >>The real problems with the Py3k list seem to be associated with a number >>of people who, despite having had little apparent connection to the >>language until now, have joined the list and started making >>inappropriate suggestions, which then have to be (patiently) reject

Re: compiling 2.3.5 on ubuntu

2006-07-17 Thread Justin Azoff
Steve Holden wrote: > I'm quessing because (s)he wants to test programs on less recent > versions of Python. Ubuntu 5.10 was already up to Python 2.4.2, so I > can't imagine there's anything older on Ubuntu 6.06. > > regards > Steve Both are avaiaible... -- - Justin -- http://mail.python.or

Re: Package organization

2006-07-17 Thread Steve Holden
Mike Wyatt wrote: > I've been playing around with Python for a few months now, and I just > recently started looking at packages to organize my growing project. So > far, I've been organizing my application into one class per module. > This has been working pretty well. For example, I simply

Re: NB question on global/local variables in functions

2006-07-17 Thread Bruno Desthuilliers
Wolfgang wrote: > Hi all, > > I've started to write some functions but I have some problems with > common variables in that functions. > > So I have some variables which should be accessible by all my functions > but not accessible by the rest of my code. How can I do this? You can use a closure

Re: Augument assignment versus regular assignment

2006-07-17 Thread Piet van Oostrum
> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote: >AP> On 2006-07-14, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>> Just read what it says. `It is only evaluated once' is quite clear I would >>> say. >AP> If it is so clear, why don't you explain it? I have done that in another thread. >>>

Re: General Hash Functions In Python

2006-07-17 Thread Arash Partow
John Machin wrote: > Who is likely to bother? In timbot we trust. Have you read the comments > at the start of Objects/dictobject.c? > No I haven't probably wont be anytime soon, as far as time, well people interested, as is how started my original port, would be more than willing to try/assess the

Re: General Hash Functions In Python

2006-07-17 Thread Arash Partow
I would like to but I think my lack of language and time will be a barrier. Also I don't believe there is much material there to warrant a technical write up. Arash Partow Be one who knows what they don't know, Instead of being one who kno

unicode html

2006-07-17 Thread lorenzo . viscanti
X-No-Archive: yes Hi, I've found lots of material on the net about unicode html conversions, but still i'm having many problems converting unicode characters to html entities. Is there any available function to solve this issue? As an example I would like to do this kind of conversion: \uc3B4 => ô

Re: Accessors in Python (getters and setters)

2006-07-17 Thread Bruno Desthuilliers
mystilleef wrote: Please don't top-post > On State and Behavior: > > To understand objects in terms of state and behavior you need to > absolve yourself from implementation details of languages > and think at an abstract level. > Take a button object, for example. It has state and behavior. Pos

Re: Problems with Tkinter and threads

2006-07-17 Thread Eric Brunel
On Mon, 17 Jul 2006 12:58:08 +0200, Claus Tondering <[EMAIL PROTECTED]> wrote: > My Tkinter application has to receive events from a TCP connection. I > have chosen to do this in the following manner: > > The TCP communication takes place in a separate thread. When I receive > data, I generate a

solving equation system

2006-07-17 Thread TG
Hi there. Anyone knows how to use numpy / scipy in order to solve this ? * A is an array of shape (n,) * X is a positive float number * B is an array of shape (n,) * O is an array of shape (n,) containing only zeros. A.X - B = O min(X) thanks. -- http://mail.python.org/mailman/listinfo/python

Re: Accessors in Python (getters and setters)

2006-07-17 Thread Bruno Desthuilliers
mystilleef wrote: > Gerhard Fiedler wrote: > >>On 2006-07-15 06:55:14, mystilleef wrote: >> >> >>>In very well designed systems, the state of an object should only be >>>changed by the object. >> >>IMO that's not quite true. Ultimately, the state always gets changed by >>something else (user inter

Re: Embedding exe file

2006-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bayazee <[EMAIL PROTECTED]> wrote: >hi,ThanX >but i dont want to save the exe file in temp file and run it . i want >to run it directly from python . maybe such this : >exec("file("test.exe","rw").read())") >i want write a cd lock with python tp protect an binary fil

Re: Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
Eric Brunel wrote: > This is where the problem is: if you do just a event_generate without > specifying the 'when' option, the binding is fired immediately in the > current thread. To be sure that an event is created and that the thread > switch actually happens, do: > > app.event_generate("<>", wh

Re: Embedding exe file

2006-07-17 Thread tac-tics
Bayazee wrote: > hi,ThanX > but i dont want to save the exe file in temp file and run it . i want > to run it directly from python . maybe such this : > exec("file("test.exe","rw").read())") > i want write a cd lock with python tp protect an binary file . and so i > dont want save it in other temp

Re: dynamic unittest

2006-07-17 Thread Oleg Paraschenko
Hello Peter, thanks a lot. I've overlooked this simple way to create the right closure. -- Oleg -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie graphing recommendations ?

2006-07-17 Thread John Hunter
> "bearophileHUGS" == bearophileHUGS <[EMAIL PROTECTED]> writes: bearophileHUGS> I think MatPlotLib can do this too, if your bearophileHUGS> computer is fast enough. >> i would also like to have the bars and graphs have nice shading >> if possible to give it a really attracti

Re: Accessors in Python (getters and setters)

2006-07-17 Thread Bruno Desthuilliers
Bruno Desthuilliers wrote: > mystilleef wrote: (snip) >>Here are the lessons I've learned (the hard way). >> >>1) Make all attributes of a class private or protected. > > > Unless they are obviously part of the implementation s/implementation/interface/, of course. > (ie: when you would > def

Re: solving equation system

2006-07-17 Thread Ben C
On 2006-07-17, TG <[EMAIL PROTECTED]> wrote: > Hi there. > > Anyone knows how to use numpy / scipy in order to solve this ? > > * A is an array of shape (n,) > * X is a positive float number > * B is an array of shape (n,) > * O is an array of shape (n,) containing only zeros. > > A.X - B = O > min

Re: how to know if socket is still connected

2006-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> serverhost = 'xxx.xxx.xxx.xxx' >> serverport = 9520 >> aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> aeris_sockobj.connect((serverhost,s

Re: Python strings outside the 128 range

2006-07-17 Thread Michael Piotrowski
On 2006-07-17 Piet van Oostrum <[EMAIL PROTECTED]> wrote: That might be a good heuristic - but on my Mac no LANG is set. So I should paraphrase my statement to "There is no reliable and cross-platform way figuring out which encoding the console uses". > >>> If LANG is not set, it's

Re: solving equation system

2006-07-17 Thread TG
Ben C wrote: > On 2006-07-17, TG <[EMAIL PROTECTED]> wrote: > > Hi there. > > > > Anyone knows how to use numpy / scipy in order to solve this ? > > > > * A is an array of shape (n,) > > * X is a positive float number > > * B is an array of shape (n,) > > * O is an array of shape (n,) containing o

Re: solving equation system

2006-07-17 Thread faulal
TG wrote: > Hi there. > > Anyone knows how to use numpy / scipy in order to solve this ? > > * A is an array of shape (n,) > * X is a positive float number > * B is an array of shape (n,) > * O is an array of shape (n,) containing only zeros. > > A.X - B = O > min(X) > > thanks. -- http://mai

Re: solving equation system

2006-07-17 Thread faulal
TG wrote: > Hi there. > > Anyone knows how to use numpy / scipy in order to solve this ? > > * A is an array of shape (n,) > * X is a positive float number > * B is an array of shape (n,) > * O is an array of shape (n,) containing only zeros. > > A.X - B = O > min(X) > > thanks. -- http://mai

Re: solving equation system

2006-07-17 Thread faulal
TG wrote: > Hi there. > > Anyone knows how to use numpy / scipy in order to solve this ? > > * A is an array of shape (n,) > * X is a positive float number > * B is an array of shape (n,) > * O is an array of shape (n,) containing only zeros. > > A.X - B = O > min(X) > > thanks. -- http://mai

Re: Problems with Tkinter and threads

2006-07-17 Thread Eric Brunel
On Mon, 17 Jul 2006 15:20:46 +0200, Claus Tondering <[EMAIL PROTECTED]> wrote: > Eric Brunel wrote: >> This is where the problem is: if you do just a event_generate without >> specifying the 'when' option, the binding is fired immediately in the >> current thread. To be sure that an event is cre

Re: solving equation system

2006-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, TG <[EMAIL PROTECTED]> wrote: >Hi there. > >Anyone knows how to use numpy / scipy in order to solve this ? > >* A is an array of shape (n,) >* X is a positive float number >* B is an array of shape (n,) >* O is an array of shape (n,) containing only zeros. > >A.X - B

Re: Commercial Programming

2006-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: >"Boomshiki" <[EMAIL PROTECTED]> writes: > >> I am aware that someone can recreate what we have done, but for them >> to cut, paste, sell is kind of a rip off. > >Unless you factor that into your business model, and create compe

Re: Commercial Programming

2006-07-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, K.S.Sreeram <[EMAIL PROTECTED]> wrote: >-=-=-=-=-=- > >Boomshiki wrote: >> And trust me, I am not worried about 16 yr olds using it without paying, why >> would they want to? I am worried about them cracking in to where their >> grades are kept. > >what you need i

Dr. Dobb's Python-URL! - weekly Python news and links (Jul 17)

2006-07-17 Thread Cameron Laird
QOTW: "Alas, Python has extensive libraries and [is] well documented to boot." - Edmond Dantes "Locking files is a complex business." - Sybren Stuvel File-locking *sounds* like an easy thing; it just isn't so in any operating system that often appears on desktops. Take advantage of t

Re: unicode html

2006-07-17 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > X-No-Archive: yes > Hi, I've found lots of material on the net about unicode html > conversions, but still i'm having many problems converting unicode > characters to html entities. Is there any available function to solve > this issue? > As an example I would like to do

wx mouse states

2006-07-17 Thread Luis Morales
Hello i using GetMouseState() to get the position in X and Y of the mouse pointer over time with the use of ScreenToCliente to get local windows coordinates in windows in work like a charm no problem the app is fast and works how it should. But on macos I get this damn error msg   ms = wx

Re: how to know if socket is still connected

2006-07-17 Thread Grant Edwards
On 2006-07-17, Cameron Laird <[EMAIL PROTECTED]> wrote: >>> works well, but sometimes the server drops the connection. so, >>> what i need is something that will let me know if the >>> connection is still ok, if not will reconnect. >> >>If the server has closed the connection, then a recv() on the

Any pyChart experts lend a hand?

2006-07-17 Thread john . mcginnis
I am attempting to generate some graphics prior to display on a webpage. I have GhostScript 8.x loaded. And I can from the code below generate the desired graphic. (it's right out of the /demos, pietest.py with some mods) Works great. However were I to paste this into the main flow of my program it

Re: What is a type error?

2006-07-17 Thread Chris Smith
Joachim Durchholz <[EMAIL PROTECTED]> wrote: > I fail to see an example that would support such a claim. > > On the other hand, UPDATE can assign any value to any field of any > record, so it's doing exactly what an assignment does. INSERT/DELETE can > create resp. destroy records, which is what

Starting a GUI application out of an console application

2006-07-17 Thread Fabian Steiner
Hello! I am currently working on an alternative for the gnome-volume-manager for multiseat systems based on HAL and DBus. Whenever the signal 'DeviceAdded' is received I would like to start a GUI-Interface where the user can choose from different options. But now I am wondering how I should st

Re: What is a type error?

2006-07-17 Thread Marshall
Chris Smith wrote: > Joachim Durchholz <[EMAIL PROTECTED]> wrote: > > I fail to see an example that would support such a claim. > > > > On the other hand, UPDATE can assign any value to any field of any > > record, so it's doing exactly what an assignment does. INSERT/DELETE can > > create resp. de

Coding style

2006-07-17 Thread PTY
Which is better? lst = [1,2,3,4,5] while lst: lst.pop() OR while len(lst) > 0: lst.pop() -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-17 Thread Simon Brunning
On 17 Jul 2006 08:56:34 -0700, PTY <[EMAIL PROTECTED]> wrote: > Which is better? > > lst = [1,2,3,4,5] > > while lst: > lst.pop() > > OR > > while len(lst) > 0: > lst.pop() How about: lst = [1,2,3,4,5] while lst: lst.pop() Or even just: lst = [] ;-) -- Cheers, Simon B, [EMAIL PROTECT

Re: Coding style

2006-07-17 Thread Steve Holden
PTY wrote: > Which is better? > > lst = [1,2,3,4,5] > > while lst: > lst.pop() > > OR > > while len(lst) > 0: > lst.pop() > The former, without a doubt. It says exactly the same thing, since lst can only be considered false when it is empty. Experienced Python programmers would scratch t

Re: Coding style

2006-07-17 Thread Tim Chase
> lst = [1,2,3,4,5] > while lst: > lst.pop() > > Or even just: > > lst = [] Subtly different though... >>> while lst: ... lst.pop() ... 5 4 3 2 1 >>> lst2 [] >>> lst = [1,2,3,4,5] >>> lst2 = lst >>> lst = [] >>> lst2 [1, 2, 3, 4, 5] >>> lst = [1,2,3,4,5] >>> lst2 = lst >>> del

Re: What is a type error?

2006-07-17 Thread Marshall
Joachim Durchholz wrote: > Marshall schrieb: > > Joachim Durchholz wrote: > >> Marshall schrieb: > >>> Good point. Perhaps I should have said "relational algebra + > >>> variables with assignment." It is interesting to consider > >>> assignment vs. the more restricted update operators: insert, > >>

Recursive function returning a list

2006-07-17 Thread Fabian Steiner
Hello! I have got a Python "Device" Object which has got a attribute (list) called children which my contain several other "Device" objects. I implemented it this way in order to achieve a kind of parent/child relationship. Now I would like to get all children of a given "Device" object and t

Re: Coding style

2006-07-17 Thread tac-tics
> Or even just: > > lst = [] > > ;-) Indeed. I'd say the second one. Empty lists are not false. They are empty. Long live dedicated boolean data types. -- http://mail.python.org/mailman/listinfo/python-list

pyKML: where to get it?

2006-07-17 Thread Bell, Kevin
When trying to download pyKML at sourceForge, it says "No File Packages Defined" ;( Does anyone know where I can get pyKML? TIA Kev. -- http://mail.python.org/mailman/listinfo/python-list

using logger module

2006-07-17 Thread David Bear
I attempted to use the logger module per the instructions in http://docs.python.org/lib/minimal-example.html I tried a couple of differnet levels. Nothing appeared in any logs. Has this module been tested with syslog-ng? That is what is packaged with suse and I am wondering if it is a version prob

Re: What is a type error?

2006-07-17 Thread Darren New
Chris Smith wrote: > Darren New <[EMAIL PROTECTED]> wrote: > >>I'm not sure what linear or uniqueness typing is. It's typestate, and if >>I remember correctly the papers I read 10 years ago, the folks at >>TJWatson that invented Hermes also invented the concept of typestate. >>They at least cl

Re: using logger module

2006-07-17 Thread [EMAIL PROTECTED]
Can you post exact code that you used? Raghu. David Bear wrote: > I attempted to use the logger module per the instructions in > http://docs.python.org/lib/minimal-example.html > > I tried a couple of differnet levels. Nothing appeared in any logs. Has this > module been tested with syslog-ng? T

Re: What is a type error?

2006-07-17 Thread Darren New
Joachim Durchholz wrote: > of no assertion language that can express such temporal relationships, > and even if there is (I'm pretty sure there is), I'm rather sceptical > that programmers would be able to write correct assertions, or correctly > interpret them - temporal logic offers several tr

Re: Starting a GUI application out of an console application

2006-07-17 Thread faulkner
put your gui application in another script and start it the same way you'd start any other application whose exit status you didn't need: os.popen* or subprocess.Popen. or, use the threading module to give your qt application another thread. Fabian Steiner wrote: > Hello! > > I am currently worki

Re: What is a type error?

2006-07-17 Thread Chris Smith
Marshall <[EMAIL PROTECTED]> wrote: > We seem to have slipped back from the hypothetical relation language > with only assignement back to SQL. I missed the point where we started discussing such a language. I suspect it was while some of us were still operating under the misconception that you

Re: Coding style

2006-07-17 Thread dwelch91
PTY wrote: > Which is better? > > lst = [1,2,3,4,5] > > while lst: > lst.pop() > > OR > > while len(lst) > 0: > lst.pop() > I think the first one is better, but if all you are doing is removing all the items in the list, this is definitely better: lst = [] -Don -- http://mail.python.o

Re: What is a type error?

2006-07-17 Thread Darren New
Marshall wrote: > I would propose that variables have identity, and values do not. > In part this is via the supplied definition of identity, in which, when > you change one thing, if something else changes as well, they > share identity. Maybe you gave a better definition the first time, but this

Re: Coding style

2006-07-17 Thread Steve Holden
tac-tics wrote: >>Or even just: >> >>lst = [] >> >>;-) > > > Indeed. > > I'd say the second one. Empty lists are not false. They are empty. Long > live dedicated boolean data types. > Take them off to where they belong! I'll bet you still write if a>3 == True: don't you ;-) regards Steve

Re: Augument assignment versus regular assignment

2006-07-17 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-07-15, Terry Reedy <[EMAIL PROTECTED]> wrote: >> The problem with understanding augmented assignment is that it directs >> the >> compiler and interpreter to do one or maybe two mostly invisible >> optimizatio

Re: Recursive function returning a list

2006-07-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Fabian Steiner wrote: > This is what I got so far: > > def getAllChildren(self, children=[]): > if self.children: > children.extend(self.children) > for child in self.children: > child.getAllChildren(children) >

Re: Recursive function returning a list

2006-07-17 Thread Steve Holden
Fabian Steiner wrote: > Hello! > > I have got a Python "Device" Object which has got a attribute (list) > called children which my contain several other "Device" objects. I > implemented it this way in order to achieve a kind of parent/child > relationship. > > Now I would like to get all chil

Re: pyKML: where to get it?

2006-07-17 Thread Steve Holden
Bell, Kevin wrote: > When trying to download pyKML at sourceForge, it says "No File Packages > Defined" ;( > > Does anyone know where I can get pyKML? > You'll probably need to read the instructions on accessing the Subversion repository, and download it from there. If they haven't made a relea

Re: What is a type error?

2006-07-17 Thread Joe Marshall
Marshall wrote: > > I am having a hard time with this very broad definition of aliasing. How about this definition: Consider three variables, i, j, and k, and a functional equivalence predicate (EQUIVALENT(i, j) returns true if for every pure function F, F(i) = F(j)). Now suppose i and j are EQ

Re: How to lock files (the easiest/best way)?

2006-07-17 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Elmo Mäntynen <[EMAIL PROTECTED]> wrote: > On Sat, 15 Jul 2006 23:52:10 +0200, Sybren Stuvel wrote: > > > Elmo Mäntynen enlightened us with: > >> Only locally. I want to be able to read/write to a single file from > >> multiple possibly parallel processes. Would

Re: how to know if socket is still connected

2006-07-17 Thread nephish
hey there, i have a question about this solution. if i have a message = socket.recv() in the script, and the socket connection drops, will the socket.recv() just wait forever for something to come across the internet port? or will it know if the connection is dropped? thanks. -sk Grant Edwards wr

sqlobject for Python 2.5

2006-07-17 Thread Phil Schmidt
I'd like to get sqlobject for Python 2.5, but it appears it's not available. Can I use sqlobject for Python 2.4 and use it on 2.5? If so, how? I have no experience using setuptools, but it appears that unless there's a specific .egg file for 2.5, then I'm outta luck. True? Thanks, Phil -- http:

Problem with sub-classing

2006-07-17 Thread Bernard Lebel
Hello, I have this problem when subclassing classes where I get this error: Traceback (most recent call last): File "

Re: compiling 2.3.5 on ubuntu

2006-07-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steve Holden wrote: >> Why are you compiling a package that is already built for you? >> > I'm quessing because (s)he wants to test programs on less recent > versions of Python. Ubuntu 5.10 was already up to Python 2.4.2, so I > can't imagine there's anything older on Ub

Re: Cool Python Ebooks Site

2006-07-17 Thread bigskipster
John Bokma wrote: > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > On 17 Jul 2006 01:39:27 GMT, John Bokma <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > > >> But everything to make a little AdSense money no? How would you like > >> it if everybody who read your messa

Re: Coding style

2006-07-17 Thread dwelch91
tac-tics wrote: > > I'd say the second one. Empty lists are not false. They are empty. Long > live dedicated boolean data types. > Uh, no, empty lists are False in a boolean context: http://docs.python.org/lib/truth.html -Don -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode html

2006-07-17 Thread Jim
Sybren Stuvel wrote: > [EMAIL PROTECTED] enlightened us with: > > > As an example I would like to do this kind of conversion: > > \uc3B4 => ô > > for all available html entities. > > Why would you want that? Just make sure you declare your document as > UTF-8, encode it as such, and you're done. M

Re: What is a type error?

2006-07-17 Thread Marshall
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > We seem to have slipped back from the hypothetical relation language > > with only assignement back to SQL. > > [...] > I don't see how such a language (limited to assignment of entire > relations) is particularly helpful to consider. I

pytables - best practices / mem leaks

2006-07-17 Thread py_genetic
I have an H5 file with one group (off the root) and two large main tables and I'm attempting to aggragate my data into 50+ new groups (off the root) with two tables per sub group. sys info: PyTables version: 1.3.2 HDF5 version: 1.6.5 numarray version: 1.5.0 Zlib version: 1.2.3 BZIP2 ve

Re: Problem with sub-classing

2006-07-17 Thread Peter Otten
Bernard Lebel wrote: > Hello, > > I have this problem when subclassing classes where I get this error: > > Traceback (most recent call last): > > File "

Re: Coding style

2006-07-17 Thread Peter Otten
Steve Holden wrote: > I'll bet you still write > > if a>3 == True: > > don't you ;-) I'll second that. if (a>3) == True: is the correct way :-) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: how to know if socket is still connected

2006-07-17 Thread Grant Edwards
On 2006-07-17, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hey there, i have a question about this solution. > if i have a > message = socket.recv() > in the script, and the socket connection drops, will the > socket.recv() just wait forever for something to come across > the internet port? or

Re: how to know if socket is still connected

2006-07-17 Thread nephish
oh, sorry, what i mean by dropped is that the server i am connecting to can close the connection. If that happens, i need to know about it. i also need to know about it if the server i am connecting to just dies. if recv() returns "" is that the same as NONE ? again, sorry, i am still kinda new at

  1   2   3   >