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

2006-01-06 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > As far as I am concerned "call by object" which is what you > *did* propose implies "call by value" to anyone who is just > learning the language, and that is the audience we're > talking about. >From what I can tell, Liskov proposed *three* different na

Re: download full sites?

2006-01-06 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi, does anyone know of any package that will download a full site for > offline viewing? It will change all url to match local urls and follow > a logical structure (the site's structure would be suffice).. Please > tell me if you have heard of such a package.. thanks a

Re: multiple clients updating same file in ftp

2006-01-07 Thread Mike Meyer
"Fuzzyman" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> > here's a simple-minded suggestion: have the first client create a text >> > file on the remote server, and delete it wh

Re: Copying files between different linux machines

2006-01-07 Thread Mike Meyer
"Thierry Lam" <[EMAIL PROTECTED]> writes: > Let's say I have two linux machines with the following names: > -linone > -lintwo > > If I'm currently on linone and if I want to copy a bunch of files from > lintwo into linone, how can that be done in a python script without > using ftp? Use scp.

Re: Try Python update

2006-01-07 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> And yes, I know about this. It's listed in "Known Problems". Anything > What's the URL to "Known Problems"? There's a strange cursor-placement > bug on Appl

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

2006-01-07 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 07 Jan 2006 01:29:46 -0500, Mike Meyer wrote: >> Call by object is the worst choice among the three, because "object" >> has such a vague meaning, so you never know what implications someone >> will

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

2006-01-07 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > In ordinary CS, "call by reference" generally means that the function is > handed a reference to the *variable* holding the *value*. That's the strictest definition of "call-by-reference". It's got a major problem in that it means doing (with C syntax)

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

2006-01-07 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > On Sat, 07 Jan 2006 01:29:46 -0500 > Mike Meyer <[EMAIL PROTECTED]> wrote: >> From what I can tell, Liskov proposed *three* different >> names for >> passing references to objects: call-by-sharing, >> call-by-obj

Re: Newbie with some doubts.

2006-01-07 Thread Mike Meyer
Claudio Grondi <[EMAIL PROTECTED]> writes: > Edgar A. Rodriguez wrote: >> Hi everybody, >> Im newbie to Python (I found it three weeks ago) , in fact Im newbie >> to >> programming. I'm being reading and training with the language, but I >> still wondering about what Classes are used to. Could you

Re: Newbie with some doubts.

2006-01-07 Thread Mike Meyer
Claudio Grondi <[EMAIL PROTECTED]> writes: > Yes, I see your point, but even putting my personal preferences > beside, for someone who just started to program, learning about the > concept of classes and inheritance is probably not what helps to get > immediate fun out of first steps in writing sma

Re: Returning Values from Bash Scripts

2006-01-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > How to execute bash scripts from python (other than using os.popen) and > get the values that those bash scripts return. The easy way is to call it with subprocess.call. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix con

Re: Try Python update

2006-01-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: > For some reason, I couldn't see the links at the end of the page; now I > can, though they look sort of "ragged", but, OK. Probably the fonts I chose. I'm in no way a good visu

Re: Returning Values from Bash Scripts

2006-01-08 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > On Sun, 08 Jan 2006 08:57:01 GMT, Tim Roberts <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>>How to execute bash scripts from python (other than using os.popen) and >>>get the values that those bash scripts return. >> Why would you eliminate os.

Re: Newbie with some doubts.

2006-01-08 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > On Sat, 07 Jan 2006 18:47:20 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > ... >> As far as I'm concerned, the definitive work in this area is Meyer's >> "Object Oriented Software Construction". He

Re: Try Python update

2006-01-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > I'm finding it hard to arrange my own experiments with Safari (I'm using > a loaner machine since my normal one[s] are all having problems and > under repair) but I'm told the solution for cursor positioning is to set > the caretPos attribute of the texta

Re: Newline at EOF Removal

2006-01-08 Thread Mike Meyer
"Alex Nordhus" <[EMAIL PROTECTED]> writes: > I am looking for a way to strip the blank line and the empty newline at > the end of the text file. I can get the blank lines removed from the > file but it always leaves the end line (which is blank) as a newline. My > code is here and it works but leav

Re: Try Python update

2006-01-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Meanwhile, other JS/DOM experts have told me that there's NO way to set > cursor position within a textarea according to w3c standards. In this > case, what your site does now may be the "least bad" approach, and that > fact might be noted in the "browse

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Safeer Tabassum wrote: >> why you are not installing it from ports? > The port distribution doesn't build to support Tkinter. Looks like they changed that recently - because it used to build it by default. Tkinter is now installed by x11-toolkits/

Re: Newline at EOF Removal

2006-01-09 Thread Mike Meyer
"Alex N" <[EMAIL PROTECTED]> writes: > Peter gave me a good clue here > w.write(f.read().rstrip('\n') + '\n') > However the 2nd \n puts that empty line at the end of the file so I No, it doesn't. Well, maybe it doesn't, depending on how your applications treats newlines. Normally, a newline termin

Re: Spelling mistakes!

2006-01-09 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Terry> But not faster than use a dict server! Why not just use (e.g.) > Terry> kdict? > > >> Maybe because not everybody has it? > > Sybren> Lame excuse. If you don't have something but you do want to use > Sybren> it, you get it. > > I don't think

Re: Help with dynamic attributes.

2006-01-09 Thread Mike Meyer
"Mr.Rech" <[EMAIL PROTECTED]> writes: > Hi all, > I was writing a simple class when I get a strange error message that I > can't > understand. Hopefully someone could help me here. > > My class's init method takes a list of lists as input argument and I'd > like to create > several attributes each

Re: testing units in a specific order?

2006-01-09 Thread Mike Meyer
Tim Peters <[EMAIL PROTECTED]> writes: > They're run in alphabetical order, sorting on the test methods' names. > For that reason some people name test methods like 'test_001', > 'test_002', ..., although unit tests really "shouldn't" case which > order they get run in. This seems sort of hard to

Re: Why keep identity-based equality comparison?

2006-01-09 Thread Mike Meyer
[EMAIL PROTECTED] writes: > My question is, what reasons are left for leaving the current default > equality operator for Py3K, not counting backwards-compatibility? > (assume that you have idset and iddict, so explicitness' cost is only > two characters, in Guido's example) Yes. Searching for ite

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >> Yes. Searching for items in heterogenous containers. With your change >> in place, the "in" operator becomes pretty much worthless on >> containers of heterogenous objects. Ditto for container methods that >> do searches for "equal" members. Whenever you

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >>> There is no way in python now to throw an exception when you >>> think comparing your object to some very different object >>> is just meaningless and using such an object in a container >>> that can be searched via the "in" operator. >> I claim that co

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
y". It's an ugly hack you have to use everytime you want to iterate through a heterogenous set doing equality tests. You're replacing "false" with an "emphathetic false", that *all* containers to change for the worse to deal with it. > Also, Mike said that you&#x

Re: Why keep identity-based equality comparison?

2006-01-10 Thread Mike Meyer
Steven Bethard <[EMAIL PROTECTED]> writes: > Not to advocate one way or the other, but how often do you use > heterogeneous containers? Pretty much everything I do has heterogenous containers of some sort or another. SQL queries made to DP API compliant modules return homogenous lists of heterogen

Re: Spelling mistakes!

2006-01-11 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On Wed, 11 Jan 2006 06:57:06 +, Steve Holden <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> I suppose most readers aren't old enough to remember the punch card >> days, when you would hand your work in on coding sheets to t

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2006-01-10, Mike Meyer schreef <[EMAIL PROTECTED]>: >>> Now you can take the practical option and decide that programmatically >>> it make no sense to compare a specific couple of values and throw an >>> exc

Re: Restart process with SIGHUP

2006-01-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I'm trying to restart a process with the os.kill command. My Problem is > that if the command gets executed, my python script stops working. I > want to SIGHUP a process with the following command: os.kill(pid, > signal.SIGHUP). That looks right. > Can anyone give me a

Re: how to improve this simple block of code

2006-01-11 Thread Mike Meyer
"py" <[EMAIL PROTECTED]> writes: > Say I have... > x = "132.00" > but I'd like to display it to be "132" ...dropping the trailing > zeros...I currently try this The two-strip solution is cleaner, but: > if x.endswith("0"): > x = x[:len(x)-1] x = x[:-1] or del x[-1] both improve t

Re: New Python.org website ?

2006-01-11 Thread Mike Meyer
Stefan Rank <[EMAIL PROTECTED]> writes: > on 11.01.2006 11:44 Steve Holden said the following: >> http://beta.python.org > Very nice! > Just wanted to note that the content area and the menu area overlap > (leaving some content unreadable) > in Opera 8.51 / WinXP Ditto for Opera 8.51 / OSX, and f

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Op 2006-01-10, Mike Meyer schreef <[EMAIL PROTECTED]>: >>>>> Now you can take the practical

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > New to Python and Programming. Trying to make scripts that will open > sites and automatically log me on. A common enough things to want to do. > The following example is from the urllib2 module. > > What are "realm" and "host" in this example. H

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > By the way, note that neither basic auth nor digest auth provide any > real security, and in fact with basic auth the userid and password are > sent *in cleartext*. For any serious production site these techniques > should probably not be used without add

Re: Why keep identity-based equality comparison?

2006-01-11 Thread Mike Meyer
Steven Bethard <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Steven Bethard writes: >>> Not to advocate one way or the other, but how often do you use >>> heterogeneous containers? >> Pretty much everything I do has heterogenous containers of some sor

Re: Python Scripts to logon to websites

2006-01-11 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Peter Hansen <[EMAIL PROTECTED]> writes: >>>By the way, note that neither basic auth nor digest auth provide any >>>real security, and in fact with basic auth the userid and password are &

Re: How to create a script that list itself ?

2006-01-11 Thread Mike Meyer
Tim Roberts <[EMAIL PROTECTED]> writes: > It was pointed out to me that the shortest Python program which produces > itself on stdout is: > -- Which, oddly enough, is also the shortest shell program that produces itself on stdout. http://www.mired.org/home/mwm/ Independe

Re: Reading from input file.

2006-01-12 Thread Mike Meyer
"Sheldon" <[EMAIL PROTECTED]> writes: > after you have read the file then split it like this: > file = open('inputfile.txt', 'r').read() > import string > file = string.split(file,'\n') You're doing things the hard way - at least if you have a modern Python. The above can be done as: file = open(

Re: Why keep identity-based equality comparison?

2006-01-12 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: >>> Op 2006-01-11, Mike Meyer schreef <[EMAIL PROTECTED]>: >>>> Antoon Pardon <[EMAIL PROTECTED]

Re: How can I create a dict that sets a flag if it's been modified

2006-01-12 Thread Mike Meyer
>> here's one attempt. (I'm no expert, so wait for better :-) >> >>> class ModFlagDict(dict): >> def __init__(self, *args, **kwargs): >> super(ModFlagDict, self).__init__(*args, **kwargs) >> self.modified = False >> def __setitem__(self, key, value): >>

Re: New Python.org website ?

2006-01-12 Thread Mike Meyer
Tim Parkin <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Of course, this is typical on the web: "Works in IE" really means >> "works in IE in the configurations we tested it for", and usually >> means "works in our favorite configuration&qu

Re: Link List in Python

2006-01-12 Thread Mike Meyer
"sri2097" <[EMAIL PROTECTED]> writes: > Hi all, I have written a Link list implementation in Python (Although > it's not needed with Lists and Dictionaries present. I tried it just > for the kicks !). Anyway here is the code - Generally very nice. > # Creating a class comprising of node in Link L

Re: Freezing

2006-01-12 Thread Mike Meyer
Xavier Morel <[EMAIL PROTECTED]> writes: >[EMAIL PROTECTED] wrote: >> Dicts and sets require immutable keys, like tuples or frozensets, but >> to me they look like a duplication. So the idea is to remove tuples and >> frozensets (and replace the few other uses of tuples with lists, like >> the % in

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Mike Meyer
"fynali" <[EMAIL PROTECTED]> writes: > Hi all, > > I have two files: Others have pointed out the Python solution - use a set instead of a list for membership testing. I want to point out a better Unix solution ('cause I probably wouldn't have written a Python program to do this): > Objective: to

Re: Conditionals stored as text to translate to real compares

2006-01-12 Thread Mike Meyer
"Randall Parker" <[EMAIL PROTECTED]> writes: > if OperatorType == ">": ># then do a greater than compare here. >BoolVal = TestVal > TargetVal > elif OperatorType == ">=": ># then do a greater or equal to here. >BoolVal = TestVal >= TargetVal > and so on. > > It would seem a lot eas

Re: Why is there no post-pre increment operator in python

2006-01-12 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Anyone has any idea on why is there no post/pre increment operators in > python ? For lots of good reasons. > Although the statement: > ++j > works but does nothing So does --j. They both parse as a value with two unary operators applied to it in succession: +(+(j)

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

2006-01-13 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> 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 problems caused this question to be raised in the fir

Re: how do "real" python programmers work?

2006-01-13 Thread Mike Meyer
"bblais" <[EMAIL PROTECTED]> writes: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier.

Re: Help with super()

2006-01-13 Thread Mike Meyer
David Hirschfield <[EMAIL PROTECTED]> writes: > I'm having trouble with the new descriptor-based mechanisms like > super() and property() stemming, most likely, from my lack of > knowledge about how they work. > > Here's an example that's giving me trouble, I know it won't work, but > it illustrate

Re: Reading from input file.

2006-01-13 Thread Mike Meyer
"Sheldon" <[EMAIL PROTECTED]> writes: > So Mike if you can do better then do it then! There are many ways do > solve a problem, perhaps you have not learned that yet. At first this > guy didn't know what to do, so he had to begin somewhere. Now you can > take hi

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 aroun

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 de

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

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

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

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 Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> 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

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

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

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 try

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

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

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

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

2006-01-15 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 14 Jan 2006 23:21:14 -0500, Mike Meyer wrote: >> So those properties of object() are all identical because they're >> really properties of object. If you define an object() by those >> properties, you have

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

2006-01-15 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 14 Jan 2006 23:26:40 -0500, Mike Meyer wrote: >>> I have no problem with that. Some objects are mutable and can change >>> their value >> If the object *is* the value, how can it change to be a different

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

2006-01-15 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sun, 15 Jan 2006 03:11:27 -0500, Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> On Sat, 14 Jan 2006 23:26:40 -0500, Mike Meyer wrote: >>>>> I have no problem with that. So

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

2006-01-15 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Bryan Olson <[EMAIL PROTECTED]> writes: >>>Mike Meyer wrote: >>>>Bryan Olson <[EMAIL PROTECTED]> writes: >>>>>Mike Meyer wrote: >>>>>>Bryan Olson wr

Re: Advice for Python Reporting Tool

2006-07-12 Thread Mike Kent
rwboley wrote: > My question is: how can I make that graphing step easier? Ideally I'd > like the chart to exist on it's own page, but I have no idea where to > even begin to implement this. Any thoughts would be appreciated. I've seen several people recommend matplotlib for this kind of thing.

Re: Multiplatform scripts: Can I avoid os.sep?

2006-07-13 Thread Mike Kent
gmax2006 wrote: > Hi, > > I am developing scripts that must run on both Linux and windows. > > My scripts contain lots of relative paths (such as log\\log.txt or > ctl\\table.ctl) If I use os.sep, it makes the code ugly. Is there any > tips or techniques to have Python automatically converts \\ to

Package organization

2006-07-15 Thread Mike Wyatt
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 "import timer", then use

Re: How to automate user input at the command prompt?

2006-07-21 Thread Mike Kent
[EMAIL PROTECTED] wrote: > You may want to look at pexpect: > > http://pexpect.sourceforge.net/ > > But I am not sure about its support on windows. To the best of my recent investigation, and an email exchange with the author of pexpect, it is NOT supported under Windows. -- http://mail.python.

Re: Package organization

2006-07-25 Thread Mike Wyatt
You read me like a book :)  I just moved from C# a few months ago, and I played with C++ for a while before that. Seriously though, for some of my more complicated subsystems (graphics, for example), putting all the classes in one module seems excessive.  Right now that subsystem has around 10

Re: Process files in order

2006-07-27 Thread Mike Kent
How about using os.listdir to build a list of filenames, then sorting them by modification time (via os.stat)? -- http://mail.python.org/mailman/listinfo/python-list

Re: newb question: file searching

2006-08-08 Thread Mike Kent
[EMAIL PROTECTED] wrote: > I'm new at Python and I need a little advice. Part of the script I'm > trying to write needs to be aware of all the files of a certain > extension in the script's path and all sub-directories. What you want is os.walk(). http://www.python.org/doc/current/lib/os-file-d

Re: The decentralized nature of the Python community is driving me crazy

2006-08-18 Thread Mike Orr
strings into documentation, and tools that run tests embedded in docstrings, and these impose a syntax on the docstrings, but in each area there are multiple programs and it's too soon to say which approach will win out. But they are gradually converging. --Mike <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python and excel macros

2006-10-18 Thread Mike P
saying earlier about big output being the active worksheet. I'll give that a go now Thanks for the advice Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 python and excel macros

2006-10-18 Thread Mike P
n't know much about python, so if any other experts outthere can give me a clue.. i'll be very appreciative Mike -- http://mail.python.org/mailman/listinfo/python-list

Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
r: unsupported operand type(s) for /: 'NormPath' and 'str' WARNING: Failure executing file: ''' Can someone explain these failures to me? Also, assuming I don't want to modify path.py itself, is there any way to do what I'm trying to accomplish? BTW, I'm running 2.4.2 under Windows. Thanks in advance, Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
/ operator joins paths. def __div__(self, rel): """ fp.__div__(rel) == fp / rel == fp.joinpath(rel) Join two path components, adding a separator character if needed. """ return self.__class__(os.path.join(self, rel)) ''' I still don't understand the TypeError in the delegation case. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems trying to override __str__ on path class

2006-10-23 Thread Mike Krell
attractiveness of the technique for new style classes, unless a way could be done to do it programatically instead of explicitly for each method. Of course, if I could get the simple override to work, the need to do this would disappear. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Want to reduce steps of an operation with dictionaries

2006-10-24 Thread Mike Erickson
.has_key(k)]) > erroneously (for me) gets: > {'a': 0, 'c': 2, 'd': 3} I am not 100% I understand your questions, but k,v are being pulled from a, try: c=dict([(k,b[k]) for v,k in enumerate(a) if b.has_key(k)]) mike -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-25 Thread Mike Kent
John Salerno wrote: > I'm a little confused. Why doesn't s evaluate to True in the first part, > but it does in the second? Is the first statement something different? > > >>> s = 'hello' > >>> s == True > False > >>> if s: > print 'hi' > > > hi > >>> > > Thanks. Excellent question!

Re: conditional computation

2006-10-26 Thread Mike Kent
robert wrote: > I want to use a computation cache scheme like > > > o = CACHECOMPUTE complex-key-expr expensive-calc-expr > > > frequently and elegantly without writing complex-key-expr or > expensive-calc-expr twice. > So its ugly: > > _=complex-key-expr; o=cache.get(_) or > cache

Re: problem with google api / xml

2006-05-31 Thread Mike Kent
robin wrote: > from SOAPpy import WSDL > WSDLFILE = '/pathtomy/googleapi/GoogleSearch.wsdl' > APIKEY = '' > _server = WSDL.Proxy(WSDLFILE) Robin, note this part of the URI set in WSDLFILE: '/pathtomy/googleapi'. Get it? 'path to my google api'. You must set this part to the actual path wh

Are there something like "Effective Python"?

2006-06-01 Thread Mike Meng
Effective C++' does for C++? For example, one of my friends read my program and suggest me to move the re.compile() out of a for-loop, since the regular pattern is fixed, and re.compile() is slow. I want to find more such advice, where can I find them? Thank you. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there something like "Effective Python"?

2006-06-02 Thread Mike Meng
Bart, I'm sorry, it's 2nd edtion. Thanks. mike BartlebyScrivener 写道: > >> I just finished reading Learning Python 3rd ed, > > For real? I thought there was only a 2nd edition. > > http://www.oreilly.com/catalog/lpython2/ -- http://mail.python.org/mailman/listinfo/python-list

[twisted] PyOpenSSL and PyCrypto are outdated!

2006-06-05 Thread Mike Meng
Hi all, I'm learning Twisted and downloaded pyOpenSSL and pycrypto win32 installer on http://twisted.sourceforge.net/contrib/ . But I find the lastest version are for Python 2.3. I try to rebuild pyOpenSSL from source, but get lots of compile errors. Are these two packages obsolated? Where ca

Re: PyOpenSSL and PyCrypto are outdated!

2006-06-05 Thread Mike Meng
n x509v3.h. My C++ compiler is Visual C++ 7.1. Should I use older OpenSSL release? Terry Reedy 写道: > "Mike Meng" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >I'm learning Twisted and downloaded pyOpenSSL and pycrypto win32 > >

Re: Xah Lee network abuse

2006-06-10 Thread Mike Schilling
"Mallor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I know I'm coming late to the barbeque. In passing, I ask: do you have > an objective, impartial perspective on the subject of committing > crimes? Because libel is a crime. It all depends on whether what you > state abou

Re: Xah Lee network abuse

2006-06-10 Thread Mike Schilling
"Philippa Cowderoy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 11 Jun 2006, Mike Schilling wrote: > >> I'm not aware of any definition of libel that includes "making statements >> that are not provably true". >>

<    11   12   13   14   15   16   17   18   19   20   >