Error

2005-07-30 Thread steve
The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment. -- Virus Warning Message (on cse.iitkgp.ernet.in) file.bat is removed from here because it contains a virus. --- http://

Re: shelve: writing out updates?!

2005-07-30 Thread Robert Kern
phil hunt wrote: > Obviously it's good when stuff is well documented. > > I wonder if the barrier to good documentation is set too high? > If i wanted to add some documentation here, I'd have to download the > current source for the latest Python documentation, download, > install and learn th

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 16:52 -0700, Bugs wrote: > Cliff Wells wrote: > > > > But how stable is GTK on systems such as Windows and OS/X? That has > > been what has kept me from using it. Most GTK apps I've used on Windows > > (including the venerable GIMP) are nowhere near as stable as their Linux

Re: Wheel-reinvention with Python

2005-07-30 Thread Cliff Wells
On Sun, 2005-07-31 at 00:59 -0400, Mike Meyer wrote: > I don't particularly like Tkinter, but it seems to me that it's pretty > much won. It seems to be installed on every desktop platform along > with Python. That means that if I want to distribute GUI apps, I'm > going to cause the least headach

Re: Wheel-reinvention with Python

2005-07-30 Thread Torsten Bronger
Hallöchen! [EMAIL PROTECTED] (phil hunt) writes: > On Sat, 30 Jul 2005 16:51:13 +0200, Torsten Bronger <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] (phil hunt) writes: >> >>> [...] >>> >>> How about sometihing with the same API as Tkinter (so no need to >>> relearn), but which looks prettier

Re: shelve: writing out updates?!

2005-07-30 Thread phil hunt
On Sat, 30 Jul 2005 17:57:17 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >Paul Rubin wrote: >> Shelve uses dbm and pickle to make a persistent object store. The >> "db" in "dbm" stands for "database" and while I didn't expect full >> ACID capability, I'd have thought there'd be at least some min

Re: shelve: writing out updates?!

2005-07-30 Thread phil hunt
On 30 Jul 2005 17:48:39 -0700, Paul Rubin wrote: >Shelve uses dbm and pickle to make a persistent object store. The >"db" in "dbm" stands for "database" and while I didn't expect full >ACID capability, What is ACID? > I'd have thought there'd be at least some minimum >

Re: Wheel-reinvention with Python

2005-07-30 Thread phil hunt
On Sat, 30 Jul 2005 16:51:13 +0200, Torsten Bronger <[EMAIL PROTECTED]> wrote: >Hallöchen! > >[EMAIL PROTECTED] (phil hunt) writes: > >> [...] >> >> How about sometihing with the same API as Tkinter (so no need to >> relearn), but which looks prettier? Would that fix your gripes? > >I haven't learn

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread phil hunt
On Sat, 30 Jul 2005 19:01:49 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >phil hunt wrote: > >> def normalizePath(p, *pathParts): >>""" Normalize a file path, by expanding the user name and getting >>the absolute path.. >>@param p [string] = a path to a file or directory >>

Re: Dabo in 30 seconds?

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 20:29 -0700, James Stroud wrote: > I am going to go ahead and throw out Dabo with all of the others that claim > quick development of an application. You try them and then you get bugs, > bugs, bugs. Or they don't compile without 16000 dependencies. Forget it. My > advice i

Re: Wheel-reinvention with Python

2005-07-30 Thread Torsten Bronger
Hallöchen! Mike Meyer <[EMAIL PROTECTED]> writes: > Torsten Bronger <[EMAIL PROTECTED]> writes: > >> Calvin Spealman <[EMAIL PROTECTED]> writes: >> >>> The choice is GUI toolkits is largely seperate from >>> Python. Consider that they are just bindings to libraries that >>> are developed complete

Re: multiple inheritance super()

2005-07-30 Thread Michele Simionato
Mike Meyer: > I think you're replying to me, but you didn't include any indication > so I can't be sure. Oops, sorry, yes, I was replying to you. > These two are cases of what I was talking about when I referred to the > Church-Turing thesis. Well, let me put it in this way. If a language can i

Re: How to convert a string like '777' to an octal integer like 0777?

2005-07-30 Thread John Machin
KB wrote: > Hi, > > This may be a rudimentary question: > > How to convert a string like '777' to an octal integer like 0777, > so that it can be used in os.chmod('myfile',0777)? > > I know the leading zero is important in os.chmod. There is no law that says constant arguments to os.chmod have

How to convert a string like '777' to an octal integer like 0777?

2005-07-30 Thread KB
Hi, This may be a rudimentary question: How to convert a string like '777' to an octal integer like 0777, so that it can be used in os.chmod('myfile',0777)? I know the leading zero is important in os.chmod. KB -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-30 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: I think you're replying to me, but you didn't include any indication so I can't be sure. > If I understand correcly you have a situation like this: > > Base > > | > > Parent1 Mixin > | | > | | > Children1 > > Base > > | > > Paren

Re: Wheel-reinvention with Python

2005-07-30 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > Calvin Spealman <[EMAIL PROTECTED]> writes: >> The choice is GUI toolkits is largely seperate from >> Python. Consider that they are just bindings to libraries that are >> developed completely seperate of the language. GUI is should be >>

Re: keylogger in Python

2005-07-30 Thread Jay
yo, thanks for the great input. And the only reason i want to create a python based keylogger is because there is none. Just a fun project... But im gonna do some more research on the keyboard drivers and stuff like that and to learn how to attach my python porgrams into the sub-processes so that i

Asking the user a question and giving him a default answer he can edit

2005-07-30 Thread levander
I'm trying to figure out the python readline module to see if it will do this. Basically, I've got a bunch of questions to ask a user, the vast majority of which, the answer will only vary by the last few characters. What I'd like to do is every time the user is asked a question, give him the defa

Re: A replacement for lambda

2005-07-30 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >>I know, lambda bashing (and defending) in the group is one of the most >>popular ways to avoid writing code. However, while staring at some Oz >>code, I noticed a feature that wo

Passing a log handle to a module? Help needed with logging module and

2005-07-30 Thread rh0dium
Hi all, So I have a slice of code which calls other python code. I have started to take a real liking to the logging module, but I want to extend this into the called python code. I have no idea how to pass the handle from the calling code into the modules.. So basically here is what I do.. --

Re: HTML Scraping??

2005-07-30 Thread Paul McGuire
There are several HTML scraping examples that ship with pyparsing, including a URL extractor, temperature display, and NTP server extractor (this last is probably closest to your question). Download pyparsing at http://pyparsing.sourceforge.net. -- Paul -- http://mail.python.org/mailman/listinf

Re: Dabo in 30 seconds?

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 23:29, James Stroud wrote: > I am going to go ahead and throw out Dabo with all of the others that claim > quick development of an application. You try them and then you get bugs, > bugs, bugs. Or they don't compile without 16000 dependencies. Forget it. My > advice is to

Re: Dabo in 30 seconds?

2005-07-30 Thread Paul Rubin
James Stroud <[EMAIL PROTECTED]> writes: > My advice is to choose something, one thing, that is REAL standard, > and in the standard library (e.g. Tkinter). And go for it. Learn it > inside and out--it will always be there for you. It is the green, > green grass of home, not that greener grass on t

Re: Dabo in 30 seconds?

2005-07-30 Thread James Stroud
On Saturday 30 July 2005 06:16 pm, EP wrote: > Ed Leafe wrote in response to the "Python vs. Access VBA" thread: > > You might want to look at Dabo, which is a database application > > framework for Python. In about 30 seconds you can create an application > > that queries a database, displays

Re: A replacement for lambda

2005-07-30 Thread Christopher Subich
Paddy wrote: > Christopher Subich <[EMAIL PROTECTED]> writes: > >>Basically, I'd rewrite the Python grammar such that: >>lambda_form ::= "<" expression "with" parameter_list ">" > > > I do prefer my parameter list to come before the expression. It would > remain consistant with simple function d

Re: A replacement for lambda

2005-07-30 Thread Christopher Subich
Paolino wrote: > why (x**2 with(x))<(x**3 with(x)) is not taken in consideration? Looks too much like a generator expression for my taste. Also, syntax could be used with 'for' instead of 'with' if PEP343 poses a problem, whereas (expr for params) is identically a generator expression. > If 'w

Re: A replacement for lambda

2005-07-30 Thread Christopher Subich
Scott David Daniels wrote: > What kind of shenanigans must a parser go through to translate: > < > > this is the comparison of two functions, but it looks like a left- > shift on a function until the second with is encountered. Then > you need to backtrack to the shift and convert it to a pa

Re: A replacement for lambda

2005-07-30 Thread Christopher Subich
Paul Rubin wrote: > Christopher Subich <[EMAIL PROTECTED]> writes: > >>My personal favourite is to replace "lambda" entirely with an >>"expression comprehension", using < and > delimeters. > > > But how does that let you get more than one expression into the > anonymous function? It doesn't. F

Re: Dabo in 30 seconds?

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 21:16, EP wrote: > Ed Leafe wrote in response to the "Python vs. Access VBA" thread: > > You might want to look at Dabo, which is a database application > > framework for Python. In about 30 seconds you can create an application > > that queries a database, displays the r

Re: shelve: writing out updates?!

2005-07-30 Thread Robert Kern
Paul Rubin wrote: > Shelve uses dbm and pickle to make a persistent object store. The > "db" in "dbm" stands for "database" and while I didn't expect full > ACID capability, I'd have thought there'd be at least some minimum > gesture towards durability of updates. But say that s is a shelve > obj

Re: pySerial Windows write problem

2005-07-30 Thread bob
Thanks heaps for the help, guys! I bit the bullit and am now leaving the serial ports open all of the time. I still think it is a driver/hardware problem. When the ports go South even a reboot of the laptop the program is running on won't fix it. The hardware is all brand new, so it should have

shelve: writing out updates?!

2005-07-30 Thread Paul Rubin
Shelve uses dbm and pickle to make a persistent object store. The "db" in "dbm" stands for "database" and while I didn't expect full ACID capability, I'd have thought there'd be at least some minimum gesture towards durability of updates. But say that s is a shelve object. If I say s[whateve

Re: Friend wants to learn python

2005-07-30 Thread [EMAIL PROTECTED]
I would recommend starting with www.freenetpages.co.uk/hp/alan.gauld . He has a particularly good way of communicating the basics of Python. Also available in a book if he needs that. PDF available from the website. www.bookpool.com has a large selection of books on Python. The "Python: How to Pro

Re: showing help(M) when running module M standalone

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 22:02:49 +0200, Chris <[EMAIL PROTECTED]> wrote: > I tried that, problem is that __all__ containts strings... Okay, that's twice I've lept before I looked. How about this: for a in __all__: print globals()[a].__doc__ HTH, Dan -- Dan Sommers

Dabo in 30 seconds?

2005-07-30 Thread EP
Ed Leafe wrote in response to the "Python vs. Access VBA" thread: > You might want to look at Dabo, which is a database application > framework for Python. In about 30 seconds you can create an application > that queries a database, displays the results, and allows for > editing/updating/

Re: showing help(M) when running module M standalone

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 22:02:49 +0200, Chris <[EMAIL PROTECTED]> wrote: > I tried that, problem is that __all__ containts strings... Oops. I should have looked before I lept. Sorry, Dan -- Dan Sommers -- http://mail.python.org/mailman/listinfo/python-list

Re: Escaping certain characters

2005-07-30 Thread Jan Danielsson
Robert Kern wrote: [---] > In [3]: s.encode('string_escape') > Out[3]: 'Hello\\nWorld!' > > In [4]: Out[3].decode('string_escape') > Out[4]: 'Hello\nWorld!' > > Not *quite* what you asked for, but it ought to be close enough. That'll do just fine. Many thanks! -- http://mail.python.org/mailman/

Re: functions without parentheses

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 18:42:59 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: > or > arr = (ArrayElementAggregator() > 11 12 13 > 21 22 23 > ) What was that again about every other computer language wanting to be Lisp? ;-) Regards, Dan -- Dan Sommers

Re: Comparison of functions

2005-07-30 Thread Bengt Richter
On Sat, 30 Jul 2005 23:37:04 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Sat, 30 Jul 2005 14:20:50 +0200, tiissa wrote: > >> Steven D'Aprano wrote: >>> Playing around with comparisons of functions (don't ask), I discovered an >>> interesting bit of unintuitive behaviour: >>> >>a = l

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Bugs
Cliff Wells wrote: > > But how stable is GTK on systems such as Windows and OS/X? That has > been what has kept me from using it. Most GTK apps I've used on Windows > (including the venerable GIMP) are nowhere near as stable as their Linux > counterparts (although this may not be entirely the fa

Re: Escaping certain characters

2005-07-30 Thread Robert Kern
Jan Danielsson wrote: > Hello, > > I'd like to encode the string that outputs: > > Hello > World! > > to 'Hello\x0aWorld!', and the string that outputs: > > Hello\World! > > to 'Hello\\World!'. > > Obviously, I want to be able to reverse the process. > > I'm going to assume this has already

Escaping certain characters

2005-07-30 Thread Jan Danielsson
Hello, I'd like to encode the string that outputs: Hello World! to 'Hello\x0aWorld!', and the string that outputs: Hello\World! to 'Hello\\World!'. Obviously, I want to be able to reverse the process. I'm going to assume this has already been solved in Python.. But how? -- http://mail.pytho

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Jorge Godoy
Ed Leafe wrote: > I'll defer this to my partner, Paul McNett. He's spearheading the > reporting > module for Dabo, and may know of some tools that are already out there > that could generate the image, which Dabo could then display. There are some out there. There's one implementation that is

Re: PEP on path module for standard library

2005-07-30 Thread Ron Adam
Bengt Richter wrote: > > > > Say, how about > > if Pathobject('gui://message_box/yn/continue > processing?').open().read().lower()!='y': > raise SystemExit, "Ok, really not continuing ;-)" > > An appropriate registered subclass for the given platform, returned when the > Patho

Re: A replacement for lambda

2005-07-30 Thread Jeff Epler
On Fri, Jul 29, 2005 at 10:14:12PM -0700, Tim Roberts wrote: > C++ solves this exact problem quite reasonably by having a greedy > tokenizer. Thus, that would always be a left shift operator. To make it > less than and a function, insert a space: > < Incidentally, I read in an article by Bj

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 17:44, Jorge Godoy wrote: > Bar and line graphics, mainly.  In an easy and portable way.  Something > that calculates the axis scales automatically, that allows users to change > some information, add legends, put values in specific points and all those > things that are c

Re: A replacement for lambda

2005-07-30 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > > sign_of_a = ternary{a < 0, -1, 1} > > I'd consider this an interesting idea if it weren't for the fact that > (at least with the fonts I generally use) I can barely make out the > difference between the {} and the () above. Ok, how about an escaped

Re: A replacement for lambda

2005-07-30 Thread Peter Hansen
Paul Rubin wrote: > How's this: f{args} (curly braces instead of parens) is the same as > f(lambda: args). > > Examples: > > launch_thread{targetfunc(a,b,c)} > b = Button{callback=pressed()} # Button remembers callback() > sign_of_a = ternary{a < 0, -1, 1} I'd consider this an inte

Re: Comparison of functions

2005-07-30 Thread Peter Hansen
Steven D'Aprano wrote: > Python already allows you to compare "this is not a number" with the float > 5.0. Mathematically, that is meaningless, but I would bet money that > 99.9% of programmers would demand that they should be able to sort the > list ["this is not a number", 5.0]. Do you think that

Re: python SMTP server

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 14:44 -0700, Fernando M. wrote: > Hi, > i made a test with smtplib module a few days ago, for sending mails, > and i was wondering if there's another module for running an SMTP > server, so i could make a standalone script for sending mails without > using an external SMTP ser

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Jorge Godoy
Ed Leafe wrote: > On Saturday 30 July 2005 16:06, Jorge Godoy wrote: > >> If it is added, let us know.  I can't think of a better way to visualize >> database reports in an easy and fast way.  Specially for BI. > > What specifically are you looking for? We are working on the report > writing e

python SMTP server

2005-07-30 Thread Fernando M.
Hi, i made a test with smtplib module a few days ago, for sending mails, and i was wondering if there's another module for running an SMTP server, so i could make a standalone script for sending mails without using an external SMTP server. I've been searching but i'm not sure if there are modules f

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 12:06 -0700, Paul Rubin wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: > > The last time I checked (as I recall), at least Wax and possibly Dabo > > both either lagged well behind recent wxPython developments of provide > > relatively limited support, leaving out a sizable

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Sat, 30 Jul 2005 08:14:16 +0100, [EMAIL PROTECTED] (phil hunt) wrote: >On Fri, 29 Jul 2005 06:37:52 GMT, Bengt Richter <[EMAIL PROTECTED]> wrote: >> >>I suggested in a previous thread that one could support such a syntax by >>supporting an invisible binary operator between two expressions, > >

Re: A replacement for lambda

2005-07-30 Thread Bengt Richter
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >I know, lambda bashing (and defending) in the group is one of the most >popular ways to avoid writing code. However, while staring at some Oz >code, I noticed a feature that would seem to make both groups happy - >if we can

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 08:01 -0600, Ivan Van Laningham wrote: > Tony Meyer wrote: > > > > >> (Those who are offended by sweeping generalisations should > > >> ignore this next bit) > > [...generalisation bit snipped...] > > > This is not only bullshit, it's elitist bullshit. "Windows users are > >

Re: A replacement for lambda

2005-07-30 Thread Bengt Richter
On Fri, 29 Jul 2005 18:07:31 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >I know, lambda bashing (and defending) in the group is one of the most >popular ways to avoid writing code. However, while staring at some Oz >code, I noticed a feature that would seem to make both groups happy - >if we can

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 16:06, Jorge Godoy wrote: > If it is added, let us know.  I can't think of a better way to visualize > database reports in an easy and fast way.  Specially for BI. What specifically are you looking for? We are working on the report writing engine now, tying in ReportLab

Re: rfc822 module bug?

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 09:08 +, Nemesis wrote: > Hi all, > I found that the function parsedate_tz of the rfc822 module has a bug > (or at least I think so). > I found a usenet article (message-id: <[EMAIL PROTECTED]>) > that has this Date field: > > Date: Tue,26 Jul 2005 13:14:27 GMT +0200 My

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Jorge Godoy
Ed Leafe wrote: > There are also several classes in wxPython that Dabo has not wrapped, > primarily the lower-level drawing classes and some of the newer graphics > classes, mainly because they weren't needed for a database application > framework. However, if there's a need, we'll be glad to add

Re: showing help(M) when running module M standalone

2005-07-30 Thread Chris
hello, thanks for all suggestions, if __name__ == '__main__': __name__ = 'MODULENAME' help(__name__) does actually work any even shows the modulename it should. chris -- http://mail.python.org/mailman/listinfo/python-list

Re: showing help(M) when running module M standalone

2005-07-30 Thread Chris
Dan Sommers wrote: > On Sat, 30 Jul 2005 17:04:50 +0200, > Chris <[EMAIL PROTECTED]> wrote: > > >>hello, >>I have a small module which only contains some utility functions. when >>running this standalone I would like to show the module docs and each >>function docs, as if doing > > >> impo

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Peter Decker
On 30 Jul 2005 12:06:43 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > wxPython also depends on wxWidgets which lags behind GTK. Can you elaborate on that? It's been over a year since I last looked at GTK, but I do remember not being very impressed with how it looked on Windows and O

Re: Selection, picking with PyOpenGL?

2005-07-30 Thread Erik Max Francis
Mike C. Fletcher wrote: > I think you're missing what's returned from the glRenderMode code (which > is non-standard OpenGL, to avoid the need for Python code using and > decoding structured pointers), from OpenGLContext: I was indeed. I was looking at the text description, which, like the Op

Re: Comparison of functions

2005-07-30 Thread Erik Max Francis
Steven D'Aprano wrote: > Um, I didn't ask to compare complex numbers using comparison operators. I > asked to sort a list. And please don't tell me that that sorting is > implemented with comparison operators. That just means that the > implementation is confusing numeric ordering with sort order.

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > The last time I checked (as I recall), at least Wax and possibly Dabo > both either lagged well behind recent wxPython developments of provide > relatively limited support, leaving out a sizable and (to me) > important number of features from what they wra

Re: A replacement for lambda

2005-07-30 Thread Paul Rubin
Seth Nielson <[EMAIL PROTECTED]> writes: > Any replacement must support the following: *delayed evaluation*. > > I need a convenient (def is not always convenient) way of saying, > "don't do this now". That is why I use lambda. How's this: f{args} (curly braces instead of parens) is the same as f

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Fri, 29 Jul 2005 20:54:42 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: > >> I suggested in a previous thread that one could support such a syntax by >> supporting an invisible binary operator between two expressions, so that >> exam

Re: Comparison of functions

2005-07-30 Thread Steven D'Aprano
On Sat, 30 Jul 2005 17:57:20 +, Adriano Varoli Piazza wrote: > Steven D'Aprano ha scritto: > >> Do you understand the difference between partial and total ordering, or >> weakly and strongly ordered? When you do understand them, come back and >> tell me again whether you still think lexicogra

Re: Wheel-reinvention with Python

2005-07-30 Thread Peter Decker
On 7/30/05, Torsten Bronger <[EMAIL PROTECTED]> wrote: > You found a solution for you, which is a good thing. I don't want > to rule out to use Dabo myself. But in my institute I'd like to > present Python as a viable alternative to Delphi. In order to > convince people who are used to a homog

Printing Docstrings Without Importing

2005-07-30 Thread Kamilche
I have a large project that is getting complex, and I would like to print the docstrings without importing the modules. The only Python utility I could find references is apparently defunct and hasn't been updated in 4 years. I don't care how spartan the output is - it could look exactly like pyth

Re: Comparison of functions

2005-07-30 Thread Steven D'Aprano
On Sat, 30 Jul 2005 16:43:00 +, Adriano Varoli Piazza wrote: > If you want to treat numbers as strings, why not convert them before > sorting them? Because that changes the object and throws away information. Here is a list, containing one complex number converted to a string, and one stri

Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 13:41, Peter Hansen wrote: > The last time I checked (as I recall), at least Wax and possibly Dabo > both either lagged well behind recent wxPython developments of provide > relatively limited support, leaving out a sizable and (to me) important > number of features from w

Re: A replacement for lambda

2005-07-30 Thread Seth Nielson
I understand that there are a number of people who wish to remove lambda entirely from the language. Nevertheless, I find it a useful and powerful tool in actual development. Any replacement must support the following: *delayed evaluation*. I need a convenient (def is not always convenient) way o

Re: Comparison of functions

2005-07-30 Thread Adriano Varoli Piazza
Steven D'Aprano ha scritto: > Do you understand the difference between partial and total ordering, or > weakly and strongly ordered? When you do understand them, come back and > tell me again whether you still think lexicographic sorting has no meaning > whatsoever. > I think I answered this in

Re: 2-player game, client and server at localhost

2005-07-30 Thread Peter Hansen
Michael Rybak wrote: > I'm writing a 2-players game that should support network mode. I'm now > testing it on 1 PC since I don't have 2. I directly use sockets, and > both client and server do computations, the only data transfered is > user mouse/kbd input. > > It works synchronously, but

Re: PEP on path module for standard library

2005-07-30 Thread Mike Orr
Sorry for the formatting of my first message; I haven't posted via Google Groups before. Reinhold Birkenfeld wrote: > > - Some way to pretty-print paths embedded in lists/dicts as strings. I > > have a > > .repr_as_str class attribute that toggles this. > > I think str() does its job nicely the

Re: string methods

2005-07-30 Thread Peter Hansen
Brian Beck wrote: > anthonyberet wrote: >>I know this touches on immutability etc, but I can't find string methods >>to return the first 3 characters, and then the last 2 characters, which >>I could concatenate with newchar to make a new string. > > As tiissa said, you want slicing: > > py> s = "

The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Peter Hansen
Ed Leafe wrote: > On Saturday 30 July 2005 12:28, Peter Decker wrote: >>It would be great if the wxPython folks would adopt Dabo, > > Thanks for the vote of encouragement! > > Our goal isn't to muddy the waters; it is simply to create a consistent API > for coding. There is already a great G

Re: Comparison of functions

2005-07-30 Thread Steven D'Aprano
On Sat, 30 Jul 2005 16:13:22 +, Adriano Varoli Piazza wrote: > Steven D'Aprano ha scritto: > >> It was easy. I never once asked myself whether some complex number was >> greater or less than another, I just asked "which one comes first in a >> lexicographic sort?" >> >> The two questions are

Re: PEP on path module for standard library

2005-07-30 Thread Reinhold Birkenfeld
Peter Hansen wrote: > Reinhold Birkenfeld wrote: >> Mike Orr wrote: >>>- I saw in a thread that .name and .parent were removed. I use them >>>very frequently, along with .ext and .namebase. I don't want to call >>>methods for these. >> >> They are now named .basename and .directory. > > Reinhol

Re: PEP on path module for standard library

2005-07-30 Thread Peter Hansen
Reinhold Birkenfeld wrote: > Mike Orr wrote: >>- Who needs .open()? open(myPath) is fine. But it can stay for >>backward compatibility. > > Right. I think it's nice for people who like a more OO approach. There's one very good reason to use .open() on a Path object, and in fact it's a (for me)

Re: Wheel-reinvention with Python

2005-07-30 Thread Torsten Bronger
Hallöchen! Peter Decker <[EMAIL PROTECTED]> writes: > On 7/30/05, Torsten Bronger <[EMAIL PROTECTED]> wrote: > >> [...] >> >> I didn't want to say that Dabo is bad. I just wanted to point >> out that its presence (and the presence of comparable projects) >> doesn't ease the IMO unfortunate situ

Re: [XML-SIG] xml-object mapping

2005-07-30 Thread Uche Ogbuji
On Thu, 2005-07-28 at 12:21 -0400, Tamas Hegedus wrote: > Hi! > > I am looking for an xml-object mapping tool ('XML Data Binding-design > time product') where I can define the mapping rules in 'binding files' > and the parser is generated automatically. > > Similar to the solution of Dave Kuhlm

Re: PEP on path module for standard library

2005-07-30 Thread Peter Hansen
Reinhold Birkenfeld wrote: > Mike Orr wrote: >>- I saw in a thread that .name and .parent were removed. I use them >>very frequently, along with .ext and .namebase. I don't want to call >>methods for these. > > They are now named .basename and .directory. Reinhold, is ".parent" now ".directory"

Re: Python language ver 2.4 , development platform 0.4

2005-07-30 Thread Michael Sparks
Dark Cowherd wrote: > The Python language is at ver 2.4 and a thing of beauty. As a > development environment IMHO it is probably 0.4 Have you considered looking at any of the commercial IDEs? Personally I *like* command line based systems, but I do know many people who swear by GUI based IDEs. I

Re: Path inherits from basestring again

2005-07-30 Thread Reinhold Birkenfeld
Michael Hoffman wrote: > Reinhold Birkenfeld wrote: > >> It's much the same as with @ decorators. Those who have used them much >> don't object to the syntax any more. > > I do and I still think they are ugly. Shouldn't have generalized that. Add "most of" where you like. Reinhold -- http://ma

Re: Comparison of functions

2005-07-30 Thread Reinhold Birkenfeld
Steven D'Aprano wrote: > On Sat, 30 Jul 2005 15:32:45 +0200, Reinhold Birkenfeld wrote: > >>> Um, I didn't ask to compare complex numbers using comparison operators. I >>> asked to sort a list. And please don't tell me that that sorting is >>> implemented with comparison operators. That just means

Re: Comparison of functions

2005-07-30 Thread Reinhold Birkenfeld
Georg Neis wrote: > * Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >> Steven D'Aprano wrote: >> 1+0j == 1 > 0 >>> True >> >> (1+0j == 1) yields True, which is comparable to 0. > > "a == b > c" is equivalent to "a == b and b > c": Right. Stupid me :) Doesn't do much to the point, though. >>

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Reinhold Birkenfeld
Steven D'Aprano wrote: > On Sat, 30 Jul 2005 14:10:52 +0200, Reinhold Birkenfeld wrote: > >> Above all, nobody can tell me that there's any programmer who doesn't >> instantly recognize '/' as a directory separator. > > Is classic Macintosh OS still supported on Python? Because Mac programmers >

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Reinhold Birkenfeld
phil hunt wrote: > def normalizePath(p, *pathParts): >""" Normalize a file path, by expanding the user name and getting >the absolute path.. >@param p [string] = a path to a file or directory >@param pathParts [list of string] = optional path parts >@return [string] = the same

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Reinhold Birkenfeld
phil hunt wrote: > On Fri, 29 Jul 2005 14:38:23 +1200, Tony Meyer <[EMAIL PROTECTED]> wrote: >>> def functions_which_modifies_some_file_in_place(path): >>> output = open(path+'.tmp', 'w') >>> . >>> >>> I dont want a seperator inserted between path and the new extension. >> >>Fair enough. Fo

Re: Path inherits from basestring again

2005-07-30 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > It's much the same as with @ decorators. Those who have used them much > don't object to the syntax any more. I do and I still think they are ugly. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Brian Beck
Ivan Van Laningham wrote: > I like / as a shortcut to joinwith(). I like it a lot. I like it so > much I'll give you a +2. +1 here. Extremely practical. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I run a program?

2005-07-30 Thread Calvin Spealman
did you try to put the filename in quotes? On 30 Jul 2005 03:33:14 -0700, Lad <[EMAIL PROTECTED]> wrote: > Hello, > I am running Python on XP and have a problem with > a program if its name consists '-' for example: > my-program.py > When I try to run a program with such name > I get the error :

Re: Comparison of functions

2005-07-30 Thread tiissa
Steven D'Aprano wrote: > It was easy. I never once asked myself whether some complex number was > greater or less than another, I just asked "which one comes first in a > lexicographic sort?" > > The two questions are NOT the same, and it is an ugliness in an otherwise > beautiful language that Py

Re: Comparison of functions

2005-07-30 Thread Kay Schluehr
Some indications: >>> for i in range(5): ... x = lambda x:x ... y = lambda y:y ... print x,y,x at 0x00EE83F0> at 0x00EE8FB0> True True at 0x00EE8AB0> at 0x00EE83F0> False False at 0x00EE8FB0> at 0x00EE8AB0> False False at 0x00EE83F0> at 0x00EE8FB0> True True at 0x00EE8AB0> at

Re: showing help(M) when running module M standalone

2005-07-30 Thread Thomas Heller
Chris <[EMAIL PROTECTED]> writes: > hello, > I have a small module which only contains some utility functions. when > running this standalone I would like to show the module docs and each > function docs, as if doing > > import M > help(M) > > I came up with the following but I reckon

Re: Comparison of functions

2005-07-30 Thread Adriano Varoli Piazza
Steven D'Aprano ha scritto: > On Sat, 30 Jul 2005 13:22:47 +, Adriano Varoli Piazza wrote: > > >>As far as I recall from Math Analysis, which I studied two months ago, >>you can't sort complex numbers. It makes no sense. The reason being >>(reading from my book), it's not possible to define a

Re: Wheel-reinvention with Python

2005-07-30 Thread Ed Leafe
On Saturday 30 July 2005 12:28, Peter Decker wrote: > It would be great if the wxPython folks would adopt Dabo, and > eventually integrate it so that there is but a single, Pythonic way of > working with wxPython, but it seems that they have their hands full > just wrapping the C++ code of wxWidge

  1   2   >