Re: Limitting the Contents of an Entry Widget in Tkinter

2006-01-14 Thread Markus Weihs
Am Sat, 14 Jan 2006 13:24:01 -0800 schrieb Dustan: > How do I limit what the user can enter in an Entry Widget? I know I can > set it to display '*' to hide a password, but what I want to do is > limit the contents to numeric characters. What is the easiest way of > doing this? Hi! Fredrik Lundh

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-14 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 15 Jan 2006 06:08:43 +, Steve Holden wrote: > > >>I just wish Mike Meyer and Steven D'Aprano were close enough that you >>could bang their heads together. In the same playground, perhaps? :-) > > > Well, after such a deeply-reasoned, well-explained refutati

urllib2.urlopen Progress bar

2006-01-14 Thread Ritesh Raj Sarraf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, In urllib.urlretrieve I can use reporthook to implement a progress bar. But in urllib2.urlopen I can't. I have to use urllib2.urlopen because it throws exceptions which are important to be handled where as urlretrieve is dumb. Is there a way to

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-14 Thread Steven D'Aprano
On Sun, 15 Jan 2006 06:08:43 +, Steve Holden wrote: > I just wish Mike Meyer and Steven D'Aprano were close enough that you > could bang their heads together. In the same playground, perhaps? :-) Well, after such a deeply-reasoned, well-explained refutation of my position, what can I do but

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 23:26:40 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Sat, 14 Jan 2006 18:26:41 -0500, Mike Meyer wrote: >>> If two objects ARE the same value, then they should be the same >>> object. >> You are assuming that values are unique, and that therefo

Re: On Numbers

2006-01-14 Thread Bengt Richter
On Sat, 14 Jan 2006 18:18:12 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >In the discussion of equality, the issue that decimal('3.0') == 3.0 is >False came up as a reason for changing the behavior of ==. The problem >with this is that the proposed change doesn't really fix anything, it >just giv

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 23:21:14 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Likewise instances of object() have a rich, object-oriented structure -- >> dir(object()) returns a list with twelve items -- but every instance is >> identical. > > That's because all the thing

Re: More than you ever wanted to know about objects

2006-01-14 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > I just wish Mike Meyer and Steven D'Aprano were close enough that you > could bang their heads together. We might be. But the results would probably be catastrophic for the surrounding area. http://www.mired.org/home/mwm/ In

PEP 309 (Partial Function Application) Idea

2006-01-14 Thread Ronald Mai
In my opinion, Ellipsis might be in the middle, not only in leftmost or rightmost, so a placeholder approach can be much more flexible and convenient. Here is a reference implementation: _ = lambda x: x.pop(0) def partial(func, *args, **keywords): def newfunc(*fargs, **fkeywords):

Re: Dynamically changing button text in python

2006-01-14 Thread marijuanated
The problem is once i set the textvariable property of the button,i cannot change the text.For example, curButton = Button(root,text="Stop Server",textvariable="this") curButton.bind("",self.StopServer) def StopServer(self,event): curButton["text"] = "Start Server" #this does not wor

Re: Wingide is a beautiful application

2006-01-14 Thread SPE - Stani's Python Editor
Sybren Stuvel schreef: > Sybren Stuvel enlightened us with: > > SPE is already annoying because of all the new windows it opens... > > Not a good start. If you mean terminal windows, that has gone with the latest release 0.8.1.d, see http://pythonide.stani.be/blog > > I remember using it before,

(Different) Try Python Update

2006-01-14 Thread Devan L
It's been a while since I've done anything, and I have finals, so if anyone wants to look at some of the source, here's the somewhat cleaned up source for bastille and modjelly. Bastille is just a sort-of-more-secure equivalent of what the code module is, in case you have no clue what it does since

[help] how to generate a empty ".MDB" file using python

2006-01-14 Thread Denton
Hi all: I working in MS window environment. Now I want to use a python script to import some data from CSV file to MDB file. but I have some problems about creating MDB file in DAO. I am using attached code , but the last line seems invalid. Does anyone could help me. Thanks! import wi

Re: More than you ever wanted to know about objects

2006-01-14 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Steve Holden <[EMAIL PROTECTED]> wrote: >... >> > 3. If two objects are equal with "==", does that >> > mean their values are the same? >> Almost universally, yes, although if you know enough about how the >> interpreter works "under the hood" you

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-14 Thread Steve Holden
Alex Martelli wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: >... > >>>3. If two objects are equal with "==", does that >>> mean their values are the same? >> >>Almost universally, yes, although if you know enough about how the >>interpreter works "under the hood" you can define the respon

Re: How to get Windows system information?

2006-01-14 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > thank you! > > from what I can see from the second website you listed, there is a way > to get harddisk space information, but is there any way to get CPU load > and RAM usage? > Have a look at the snippet: #>>> import wmi #>>> t = wmi.WMI() #>>> for i in t.Win32_Perf

Re: More than you ever wanted to know about objects [was: Is everything a refrence or isn't it]

2006-01-14 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: ... > > 3. If two objects are equal with "==", does that > > mean their values are the same? > > Almost universally, yes, although if you know enough about how the > interpreter works "under the hood" you can define the response of > instances of your

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-14 Thread Fernando Perez
R. Bernstein wrote: > In doing the extension to the python debugger which I have here: > http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 > I came across one little thing that it would be nice to get done better. > > I notice on stack traces and tracebacks, an exec

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 14 Jan 2006 18:26:41 -0500, Mike Meyer wrote: >> If two objects ARE the same value, then they should be the same >> object. > You are assuming that values are unique, and that therefore is X "is" (in > the English sense, not the Python sense) s

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Likewise instances of object() have a rich, object-oriented structure -- > dir(object()) returns a list with twelve items -- but every instance is > identical. That's because all the things in dir(object()) are also in dir(object): >>> dir(object) ==

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Bryan Olson <[EMAIL PROTECTED]> writes: >>>Mike Meyer wrote: Bryan Olson writes: >[EMAIL PROTECTED] wrote: >>The reason is that I am still trying to figure out >>what a value is myself. Do all objects have values? >

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 18:26:41 -0500, Mike Meyer wrote: > If two objects ARE the same value, then they should be the same > object. You are assuming that values are unique, and that therefore is X "is" (in the English sense, not the Python sense) some value, then no other thing Y can also be the s

Re: Why keep identity-based equality comparison?

2006-01-14 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Noam Raphael <[EMAIL PROTECTED]> writes: >Also note that using the current behaviour, you can't easily >treat objects that do define a meaningful value comparison, by >identity. Yes you can. Just use the "is" operator.

Re: How to get Windows system information?

2006-01-14 Thread dpickles
thank you! from what I can see from the second website you listed, there is a way to get harddisk space information, but is there any way to get CPU load and RAM usage? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 18:49:43 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> object instances are like electrons (note for pedants: in classical >> physics, not QED): they are all exactly the same, distinguishable only by >> their position in time and space (or memory loc

Re: Recursive tree list from dictionary

2006-01-14 Thread David Pratt
Hi Bengt! I have been banging my head on this one all day! This is brilliant (and recursive through each level which is exactly what I was trying to work out)! Only part I needed to modify is else: return title to else: return [title] I tell you, you've made my day! I was getting a bit discou

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Steve Holden
Mike wrote: > Hi, > > The example below shows that result of a marshaled data structure is > nothing but a string > > data = {2:'two', 3:'three'} import marshal bytes = marshal.dumps(data) type(bytes) > > > bytes > > '{i\x02\x00\x00\x00t\x03\x00\x00\x00twoi\x03\x00\x00\x0

Re: Recursive tree list from dictionary

2006-01-14 Thread Bengt Richter
On Sat, 14 Jan 2006 16:46:29 -0400, David Pratt <[EMAIL PROTECTED]> wrote: >Hi Allan, Max, and bearophile > >Many thanks for your replies to this. The number of levels can be deeper >than two for creating child, sibling relationships. This can lead to >futher nesting as shown in my sample result

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson <[EMAIL PROTECTED]> writes: > >>Mike Meyer wrote: >> >>>Bryan Olson writes: >>> [EMAIL PROTECTED] wrote: >The reason is that I am still trying to figure out >what a value is myself. Do all objects have values? Yes. >>> >>>Can you just

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: distance_in_feet = 5 weight_in_milligrams = 5 distance_in_feet == weight_in_milligrams > True > Since when is a distance comparable to a weight, let alone equal? The latest (and most impressive to date) to fix this is frink: http://futureb

Re: Why keep identity-based equality comparison?

2006-01-14 Thread Noam Raphael
Mike Meyer wrote: > Noam Raphael <[EMAIL PROTECTED]> writes: > Also note that using the current behaviour, you can't easily treat objects that do define a meaningful value comparison, by identity. >>> >>>Yes you can. Just use the "is" operator. >> >>Sorry, I wasn't clear enough. In "tr

Re: On Numbers

2006-01-14 Thread Dan Sommers
On Sat, 14 Jan 2006 18:18:12 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > ... the proposed change doesn't really fix anything, it just gives > different wrong behavior ... :-) > To get started on that, I want to consider how other languages with > rich numeric type systems model them. I'm goi

Re: Getting better traceback info on exec and execfile - introspection?

2006-01-14 Thread R. Bernstein
I suggested: > And suppose instead of '' I'd like to give the value or the > leading prefix of the value instead of the unhelpful word ''? > How would one do that? Again, one way is to go into the outer frame > get the source line (if that exists), parse that and interpolate > argument to exec(file

Listing partitions (on win32)

2006-01-14 Thread Claude Henchoz
Hi Is there any way of listing partitions on a (win32) computer without using WMI? Cheers, Claude -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python.org website ?

2006-01-14 Thread Fernando Perez
Tim Chase wrote: >> http://beta.python.org > > In both Mozilla-suite (1.7) and FireFox (1.5), the links on the > left (the grey-backgrounded all-caps with the ">>" at the right) > all intrude into the body text. They're all the same length: Just as an FYI, I see the same problem under Linux, us

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 18:21:28 -0500, Mike Meyer wrote: > Paul Rubin writes: >> Mike Meyer <[EMAIL PROTECTED]> writes: >>> > Whether the '==' operation conforms to your idea of what equality >>> > means is unclear. >>> Care to say what it does mean, then? >> I'd say a==b d

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: | Paul Rubin writes: |> Mike Meyer <[EMAIL PROTECTED]> writes: |>> > Whether the '==' operation conforms to your idea of what equality |>> > means is unclear. |>> Care to say what it does mean, then? |> I'd say a==b doesn't necessaril

Re: New Python.org website ?

2006-01-14 Thread Mike Meyer
Martin Maney <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> >> http://beta.python.org >> In particular, creating a good-looking design that remains readable in >> all possible browser configurations is impossible. Getting one that is >> readable in all reasonable browser con

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > object instances are like electrons (note for pedants: in classical > physics, not QED): they are all exactly the same, distinguishable only by > their position in time and space (or memory location). Except all electrons aren't exactly the same - beca

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 14 Jan 2006 14:14:01 +, Antoon Pardon wrote: >> On 2006-01-14, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>> On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: It would help if you or someone would answer these five questions (with

Re: Just want to walk a single directory

2006-01-14 Thread SB
Thanks Tim, this definitely does it. I was trying to prevent having to spend time absorbing the core of how generators work, because this simple is all I need to do, and I don't have the updated python cookbook book. The one I have discussed the old os.path.walk. Tim Peters <[EMAIL PROTECTED]

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Paul Rubin writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > Whether the '==' operation conforms to your idea of what equality >> > means is unclear. >> Care to say what it does mean, then? > I'd say a==b doesn't necessarily mean a and b have the same value. Care to

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 13:50:24 -0800, Mike wrote: > Thanks everyone. > > Why Marshal & not Pickle: Well, Marshal is supposed to be faster. Faster than cPickle? Even faster would be to write your code in assembly, and dump that ridiculously bloated database and just write everything to raw bytes

On Numbers

2006-01-14 Thread Mike Meyer
In the discussion of equality, the issue that decimal('3.0') == 3.0 is False came up as a reason for changing the behavior of ==. The problem with this is that the proposed change doesn't really fix anything, it just gives different wrong behavior. The correct fix would seem to be fixing python's h

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 17:33:07 -0500, Mike Meyer wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> On Sat, 14 Jan 2006 04:22:53 +, Donn Cave wrote: >>> |> 2. What is the value of object()? >>> [ I assume you mean, the object returned by object(). ] >>> It doesn't really have a value. I ca

Re: New Python.org website ?

2006-01-14 Thread Martin Maney
Mike Meyer <[EMAIL PROTECTED]> wrote: > >> http://beta.python.org > In particular, creating a good-looking design that remains readable in > all possible browser configurations is impossible. Getting one that is > readable in all reasonable browser configurations is hard, unless you > make your d

Re: Limitting the Contents of an Entry Widget in Tkinter

2006-01-14 Thread James Stroud
Dustan wrote: > How do I limit what the user can enter in an Entry Widget? I know I can > set it to display '*' to hide a password, but what I want to do is > limit the contents to numeric characters. What is the easiest way of > doing this? > You can check the source of tkSimpleDialog.askfloat,

Re: Just want to walk a single directory

2006-01-14 Thread Tim Peters
[EMAIL PROTECTED] > I have a super-simple need to just walk the files in a single directory. > > I thought this would do it, but "permanentFilelist" ends up containing > all folders in all subdirectories. All folders everywhere, or all file (not directory) names in the top two levels? It looks li

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Steven D'Aprano
On Sat, 14 Jan 2006 14:14:01 +, Antoon Pardon wrote: > On 2006-01-14, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: >> >>> It would help if you or someone would answer these >>> five questions (with something more than "yes" or "no" :-) >>> >>>

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > Whether the '==' operation conforms to your idea of what equality > > means is unclear. > > Care to say what it does mean, then? class boffo(int): def __eq__(x,y): return True a,b = boffo(2), boffo(3) print a+b, a==b, (a+2)==(b+2) I

Just want to walk a single directory

2006-01-14 Thread SB
Hi, I have a super-simple need to just walk the files in a single directory. I thought this would do it, but "permanentFilelist" ends up containing all folders in all subdirectories. Could someone spot the problem? I've scoured some threads using XNews reg expressions involving os.walk, but co

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Jean-Paul Calderone
On Sat, 14 Jan 2006 16:58:55 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >"Giovanni Bajo" <[EMAIL PROTECTED]> writes: >> [EMAIL PROTECTED] wrote: >>> Try... >> for i in bytes: print ord(i) >>> or >> len(bytes) >>> What you see isn't always what you have. Your database is capable of >>> sto

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
"Donn Cave" <[EMAIL PROTECTED]> writes: > |> 3. If two objects are equal with "==", does that > |> mean their values are the same? > Yes. > | >>> 3.0 == 3 > | True > Evidently the value of 3.0 is the same as the value of 3. And they do. They are two different representations of the same value. M

Re: two questions about thread

2006-01-14 Thread Bryan Olson
iclinux wrote: > a. how to exit the whole process in a thread? > b. when thread doing a infinite loops, how to terminate the process?: As others noted, the threading module offers Thread.setDaemon. As the doc says: "The entire Python program exits when no active non-daemon threads are left." Py

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 14 Jan 2006 04:22:53 +, Donn Cave wrote: >> |> 2. What is the value of object()? >> [ I assume you mean, the object returned by object(). ] >> It doesn't really have a value. I can't think of any kind of >> computation that could use this o

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Bryan Olson writes: >>>[EMAIL PROTECTED] wrote: >>> The reason is that I am still trying to figure out what a value is myself. Do all objects have values? >>>Yes. >> Can you justify this, other than by quoting the manual whose

Re: How to remove subset from a file efficiently?

2006-01-14 Thread Bengt Richter
On 13 Jan 2006 23:17:05 -0800, [EMAIL PROTECTED] wrote: > >fynali wrote: >> $ cat cleanup_ray.py >> #!/usr/bin/python >> import itertools >> >> b = set(file('/home/sajid/python/wip/stc/2/CBR333')) >> >> file('PSP-CBR.dat,ray','w').writelines(itertools.ifilterfalse(b.__contains__,fi

Re: New Python.org website ?

2006-01-14 Thread Tim Parkin
Fuzzyman wrote: >Tim Parkin wrote: >[snip..] > > >>Hi Fuzzyman, >> >>Thanks for the feedback and volunteering to contribue... The list of >>already built sections is not really up to date but I have added a few >>tickets to the trac on some sections of content that need working on. If >> >>

Re: Why keep identity-based equality comparison?

2006-01-14 Thread Mike Meyer
Noam Raphael <[EMAIL PROTECTED]> writes: >>>Also note that using the current behaviour, you can't easily >>>treat objects that do define a meaningful value comparison, by >>>identity. >> Yes you can. Just use the "is" operator. > Sorry, I wasn't clear enough. In "treating" I meant how containers >

Re: SQLObject connection/transaction blowing up

2006-01-14 Thread jacob . miles
No - I want autoCommit to be false. It defaults to true. SQLObject's documentation says to leave the value blank for false, and to specify any non-blank value for true. Is the SQLObject documentation wrong? Should I specify autoCommit=0? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > > >>>The identity is not, in itself, a part of the value. >>> >>>Python doesn't query the object to determine it's type or identity, but it >>>always has to query the object to access the value. >> >> > >> >>>A look at the C implementation of a typical

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Mike Meyer
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> Try... > for i in bytes: print ord(i) >> or > len(bytes) >> What you see isn't always what you have. Your database is capable of >> storing \ x 0 0 characters, but your string contains a single byte of >> value zero.

Re: SQLObject connection/transaction blowing up

2006-01-14 Thread paul kölle
[EMAIL PROTECTED] wrote: > I'm trying to connect to a mysql database, with autoCommit and caching > off, and I'm trying to create a transaction. Why does this blow up? As the traceback is telling you, your connectionString is missing the actual values. Not sure about the cache parameter but: conne

Re: Marshal Obj is String or Binary?

2006-01-14 Thread Mike
Thanks everyone. Why Marshal & not Pickle: Well, Marshal is supposed to be faster. But then, if I wanted to do the whole repr()-eval() hack, I am already defeating the purpose by refusing to save bytes as bytes in terms of both size and speed. At this point, I am considering one of the following:

Re: Dynamically changing button text in python

2006-01-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > for example,can we do something like this: > > curButton.bind("",self.StopServer) > > def StopServer(self,event): >curButton["text"] = "Start Server" Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: PDA Implementations

2006-01-14 Thread Mike Meyer
"gregarican" <[EMAIL PROTECTED]> writes: > I am in the process of creating an app that runs on various PDA > platforms. Currently I have it running on ARM Linux (Sharp Zaurus) and > am starting to port it over to ARM Windows Mobile (Dell Axim). Using > Python has made the task particularly easier

Re: SQLObject connection pooling

2006-01-14 Thread EleSSaR^
[EMAIL PROTECTED] si è profuso/a a scrivere su comp.lang.python tutte queste elucubrazioni: > Hello. Does SQLObject provide connection pooling? If so, is it > automatic or do I have to do something to manage it? If not, how do > people generally solve this problem? I think you will have bette

Re: Why keep identity-based equality comparison?

2006-01-14 Thread Noam Raphael
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > >>try: >>return a == b >>except TypeError: >>return a is b > > > This isn't "easy". It's an ugly hack you have to use everytime you > want to iterate through a heterogenous set doing equality tests. I wouldn't define this as an "ugly ha

Re: Freezing

2006-01-14 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer: >>Actually, I like the "len" model, which would be a new builtin that uses the >>__freeze__ method.< > Well, I presume this is a matter of personal tastes and consistency > too. This time I appreciate the freeze() too, but probably some people > can think th

SQLObject connection pooling

2006-01-14 Thread jacob . miles
Hello. Does SQLObject provide connection pooling? If so, is it automatic or do I have to do something to manage it? If not, how do people generally solve this problem? Thanks for any help. - Jake -- http://mail.python.org/mailman/listinfo/python-list

SQLObject connection/transaction blowing up

2006-01-14 Thread jacob . miles
I'm trying to connect to a mysql database, with autoCommit and caching off, and I'm trying to create a transaction. Why does this blow up? >>> from sqlobject import * >>> connectionString = 'mysql://[EMAIL >>> PROTECTED]/mc_image_library_dev?cache=&autoCommit=' >>> connection = connectionForURI

Re: [OT] - Requesting Comments for Process Definition and Presentation

2006-01-14 Thread Ilias Lazaridis
Steve Holden wrote: > Ilias Lazaridis wrote: >> Ilias Lazaridis wrote: >>> comp.lang.python / comp.lang.ruby >>> >>> I would like to ask for feedback on the Process Definition and >>> Presentation. [...] >> Based on the summary of the feedback so far, I've focused on one page >> - the main page:

Limitting the Contents of an Entry Widget in Tkinter

2006-01-14 Thread Dustan
How do I limit what the user can enter in an Entry Widget? I know I can set it to display '*' to hide a password, but what I want to do is limit the contents to numeric characters. What is the easiest way of doing this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why keep identity-based equality comparison?

2006-01-14 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >> If you >> want to argue that the builtin sets should do that, you can - but >> that's unrelated to the question of how the comparison operators >> behave for the rest of the bulitin types. > What I argue is that there is no single order for a specific ty

Re: how do "real" python programmers work?

2006-01-14 Thread Mike Meyer
Tom Anderson <[EMAIL PROTECTED]> writes: > On Thu, 12 Jan 2006, Mike Meyer wrote: >> well, we need a term for development environment built out of Unix >> tools > Disintegrated development environment? Differentiated development > environment? How about just a development environment? I'd like

Re: how do "real" python programmers work?

2006-01-14 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> we need a term for development environment built out of Unix tools > We already have one. The term is "emacs". So people using a development environment built around vim's pyhon mode are using emacs?

Re: Recursive tree list from dictionary

2006-01-14 Thread David Pratt
Hi Allan, Max, and bearophile Many thanks for your replies to this. The number of levels can be deeper than two for creating child, sibling relationships. This can lead to futher nesting as shown in my sample result list (the result I am attempting to acheive) which is reason that I believe thi

Re: Recursive tree list from dictionary

2006-01-14 Thread Alan Franzoni
Il Sat, 14 Jan 2006 13:52:43 -0400, David Pratt ha scritto: > source_list =[ I don't understand what you mean by saying that 'levels of categorization is not fixed', are there more than two keys in any dictionary? Basically, thus, you have a list of dictionaries and you want to get a list of lis

Re: Newcomer question wrt variable scope/namespaces

2006-01-14 Thread Diez B. Roggisch
Florian Daniel Otel wrote: > Gary, > > First of all, many thanks for the reply. Do I understand it correctly > that actually the rule has to be refined as pertaining to the (so > called) "immutable" types (like e.g. integers, tuples/strings) > whereas lists and dictionaries are "mutable" types

Re: Recursive tree list from dictionary

2006-01-14 Thread bearophileHUGS
This isn't much tested, so don't trust it much, and I hope it's not overkill. You can find Graph here: http://sourceforge.net/projects/pynetwork/ With this you can plot the tree, if you want: g.springCoords(); g.plot2d() Bear hugs, bearophile def scan(g, parent): subs = [scan(g, sub) for sub

Re: Recursive tree list from dictionary

2006-01-14 Thread Max Erickson
David Pratt <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi. I am wanting to create a tree list result structure from a > dictionary to categorize results. The dictionary contains elements > that identify its parent. The levels of categorization is not fixed, > so there is a need for t

Re: Pythonic wrappers for SQL?

2006-01-14 Thread Steve Holden
Kenneth McDonald wrote: > I need to do some data manipulation, and SQLite is a nice little > product for it, except of course that I'd need to write SQL. Are > there any good libraries out there that let one write (basic) queries > in a Pythonic syntax, rather than directly in SQL? > SQLObje

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Aahz
In article <[EMAIL PROTECTED]>, Scott David Daniels <[EMAIL PROTECTED]> wrote: > >An important help to some people's understanding of objects is >realizing how they are used. Sometimes an object is used to mediate >between the real world and a program. For example, you could design >an object wh

Re: Pythonic wrappers for SQL?

2006-01-14 Thread David Pratt
Hi Kenneth. Try SQLAlchemy. Regards, David Kenneth McDonald wrote: > I need to do some data manipulation, and SQLite is a nice little > product for it, except of course that I'd need to write SQL. Are > there any good libraries out there that let one write (basic) queries > in a Pythonic s

Recursive tree list from dictionary

2006-01-14 Thread David Pratt
Hi. I am wanting to create a tree list result structure from a dictionary to categorize results. The dictionary contains elements that identify its parent. The levels of categorization is not fixed, so there is a need for the code to be recursive to drill down to the lowest level. I have contri

Re: Sudoku solver: reduction + brute force

2006-01-14 Thread Bas
There is more in this thread: http://groups.google.com/group/comp.lang.python/browse_frm/thread/479c1dc768f740a3/9252dab14e8ecabb?q=sudoku&rnum=2#9252dab14e8ecabb Enjoy, Bas -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Python

2006-01-14 Thread alexander . limi
Christian Tismer wrote: > Thanks to Carl Friedrich, I restarted the Zope process. > > I have no idea why it broke, the site was running since 38 days > without problems. The Zope/Plone process was still there, blocking > the port. > > Maybe I should go for something simpler than Plone... Hi Chris

Re: two questions about thread

2006-01-14 Thread Diez B. Roggisch
iclinux wrote: > hi there, > > I'm new to python, and have two questions: > > a. how to exit the whole process in a thread? sys.exit() Works only if Thread.setDaemon(True) is invoked on all threads. > b. when thread doing a infinite loops, how to terminate the process?: > it seems that th

Dynamically changing button text in python

2006-01-14 Thread marijuanated
Hi all, I am wondering if i could change a button text dynamically in its handler. for example,can we do something like this: curButton.bind("",self.StopServer) def StopServer(self,event): curButton["text"] = "Start Server" Thanks, Sundar -- http://mail.python.org/mailman/listinfo

Re: Running python apps from within python apps

2006-01-14 Thread Peter Hansen
aph wrote: > actually 'exec()' is the function I was looking for. Working code: > > class myApp: > > def kalle(self,str): > return str.upper() > > def run_script(self,script): > exec(script) > > app = myApp() > app.run_script("print self.kalle('hello')") A very minor po

Re: Running python apps from within python apps

2006-01-14 Thread Claudio Grondi
aph wrote: > actually 'exec()' is the function I was looking for. Working code: > > class myApp: > > def kalle(self,str): > return str.upper() > > def run_script(self,script): > exec(script) > > app = myApp() > app.run_script("print self.kalle('hello')") > > Thanks... >

Re: Spanish Translation of any python Book?

2006-01-14 Thread gene tani
Luis M. González wrote: > Lamentablemente, no conozco ningún tutorial o libro en castellano... http://www.python.org/doc/NonEnglish.html#spanish -- http://mail.python.org/mailman/listinfo/python-list

Re: Running python apps from within python apps

2006-01-14 Thread aph
actually 'exec()' is the function I was looking for. Working code: class myApp: def kalle(self,str): return str.upper() def run_script(self,script): exec(script) app = myApp() app.run_script("print self.kalle('hello')") Thanks... -- http://mail.python.org/mailman/list

Getting better traceback info on exec and execfile - introspection?

2006-01-14 Thread R. Bernstein
In doing the extension to the python debugger which I have here: http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 I came across one little thing that it would be nice to get done better. I notice on stack traces and tracebacks, an exec or execfile command appears as

Re: Running python apps from within python apps

2006-01-14 Thread Claudio Grondi
aph wrote: > Hello. I'm sure this has been asked before, but I can't find an answer > anywhere. > > I want to create a truly "dynamic" app which can get new functions > "on-the-fly" and run them without having to re-start the main app. > > I've found the code module that looks kind of hopefull. F

Running python apps from within python apps

2006-01-14 Thread aph
Hello. I'm sure this has been asked before, but I can't find an answer anywhere. I want to create a truly "dynamic" app which can get new functions "on-the-fly" and run them without having to re-start the main app. I've found the code module that looks kind of hopefull. For instance this works gr

Re: Sudoku solver: reduction + brute force

2006-01-14 Thread Pavol . Severa
ago wrote: > Inspired by some recent readings on LinuxJournal and an ASPN recipe, I > decided to revamp my old python hack... The new code is a combination > of (2) reduction methods and brute force and it is quite faster than > the > ASPN program. If anyone is interested I attached the code in > h

Re: Sudoku solver: reduction + brute force

2006-01-14 Thread Pavol . Severa
ago wrote: > Inspired by some recent readings on LinuxJournal and an ASPN recipe, I > decided to revamp my old python hack... The new code is a combination > of (2) reduction methods and brute force and it is quite faster than > the > ASPN program. If anyone is interested I attached the code in > h

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Antoon Pardon
On 2006-01-14, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 12 Jan 2006 16:11:53 -0800, rurpy wrote: > >> It would help if you or someone would answer these >> five questions (with something more than "yes" or "no" :-) >> >> 1. Do all objects have values? > > All objects ARE values. Some v

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Scott David Daniels
Steven D'Aprano wrote: > Let's try not to be too deep here, okay? Before asking "what is the value > of foo?", we have to agree on what we mean by "value". It is easy to tie > yourself into knots here. An important help to some people's understanding of objects is realizing how they are used. Som

  1   2   >