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: 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

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: 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

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: 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: 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: 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: 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: 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 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: 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: 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: 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: 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: 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 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
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: 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: 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: 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 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: 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

[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

(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

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,

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

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: 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

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: 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: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: 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

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 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

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

<    1   2