Re: Land Of Lisp is out

2010-10-27 Thread TheFlyingDutchman
On Oct 27, 4:55 pm, Lawrence D'Oliveiro wrote: > Would it be right to say that the only Lisp still in common use is the Elisp > built into Emacs? There is a new version of Lisp called Clojure that runs on the Java Virtual Machine (JVM) that is on the upswing. Don't know how many users it has but

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
gt; > >         Message-ID: > >         <0497e39d-6bd1-429d-a86f-f4c89babe...@u31g2000pru.googlegroups.com> > >         From: TheFlyingDutchman > >         Newsgroups: comp.lang.lisp > > >         [...] > >         in C I can have a function maximum(int a, int b)

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> >         in C I can have a function maximum(int a, int b) that will always > >         work. Never blow up, and never give an invalid answer. If someone > >         tries to call it incorrectly it is a compile error. > > I would agree that the third sentence is arguably wrong, simply > because

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > > If I had to choose between "blow up" or "invalid answer" I would pick > > "invalid answer". > > there are some application domains where neither option would be > viewed as a satisfactory error handling strategy. Fly-by-wire, petro- > chemicals, nuclear power generation. Hell you'd expect be

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > > "in C I can have a function maximum(int a, int b) that will always > > work. Never blow up, and never give an invalid answer. " > > > Dynamic typed languages like Python fail in this case on "Never blows > > up". > > How do you define "Never blows up"? Never has execution halt. I think a k

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
On Sep 30, 1:40 am, RG wrote: > In article > <5bf24e59-1be0-4d31-9fa7-c03a8bf9b...@y12g2000prb.googlegroups.com>, > > > > > >  TheFlyingDutchman wrote: > > > > Yes.  Nonetheless, the maximum() function does exactly what it is > > > > inte

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
On Sep 30, 1:02 am, Paul Rubin wrote: > >> > > > in C I can have a function maximum(int a, int b) that will always > >> > > > work. Never blow up, and never give an invalid answer. If someone > >> > > > tries to call it incorrectly it is a compile error. > > The second sentence is not disproved by

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > Yes.  Nonetheless, the maximum() function does exactly what it is intended > > to do *with the inputs it receives*.  The failure is outside the function; > > it did the right thing with the data actually passed to it, the problem > > was a user misunderstanding as to what data were being passe

Re: "Strong typing vs. strong testing"

2010-09-29 Thread TheFlyingDutchman
> > That argument can be made for dynamic language as well. If you write in > dynamic language (e.g. python): > > def maximum(a, b): >     return a if a > b else b > > The dynamic language's version of maximum() function is 100% correct -- > if you passed an uncomparable object, instead of a numbe

Re: "Strong typing vs. strong testing"

2010-09-29 Thread TheFlyingDutchman
> > More specifically, the claim made above: > > > in C I can have a function maximum(int a, int b) that will always > > work. Never blow up, and never give an invalid answer. > > is false.  And it is not necessary to invoke the vagaries of run-time > input to demonstrate that it is false. > I don

Re: A portable LISP interpreter that includes all the major list-processing functions is described. A complete, annotated listing of the program's code, written in PASCAL, is included.

2010-07-23 Thread TheFlyingDutchman
On Jul 23, 12:06 pm, Emmy Noether wrote: > Title   Portable LISP interpreter > Creator/Author  Cox, L.A. Jr. ; Taylor, W.P. > Publication Date        1978 May 31 > OSTI Identifier OSTI ID: 7017786 > Report Number(s)        UCRL-52417 > DOE Contract Number     W-7405-ENG-48 > Resource Type   Techni

Re: A java hobbyist programmer learning python

2009-01-25 Thread TheFlyingDutchman
>         If you're building an extension tree, you'll either have to supply > layers of getter/setter methods, or hand-mangle references to attributes > defined in the superclass. > >         Say you start with a "Point2D" class, and make the X, Y coordinates > double underscore. > >         Now e

Re: A java hobbyist programmer learning python

2009-01-24 Thread TheFlyingDutchman
On Jan 23, 8:57 am, Dennis Lee Bieber wrote: > On Fri, 23 Jan 2009 01:48:32 -0800 (PST), TheFlyingDutchman > declaimed the following in comp.lang.python: > > > abstraction. In Python, all class attributes are public but names may > > be "mangled" to discourage una

Re: A java hobbyist programmer learning python

2009-01-23 Thread TheFlyingDutchman
> > * No getters and setters. Python takes a very permissive approach to > class attributes, taking the philosophy "we're all adults here". It's > easy to change a public attribute to a private attribute with a getter/ > setter if you need to, so there's nothing to be gained by writing getters > f

Re: Overloading Methods

2009-01-20 Thread TheFlyingDutchman
> > class Foo(object): > def __init__(self, a, b=10, c=None): > > Whereas in Java or C++ this would require several overloads, it can be > succinctly expressed as a single method in Python. > Not that it's important to the discussion, but, while Java does not have the capability to give defau

Re: Writing a CGI to query DB

2007-11-10 Thread TheFlyingDutchman
On Nov 9, 8:33 pm, Bighead <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently working on a CGI deployed on an Apache server, which, > given an arbitrary SQL, fetches raw data from a remote DB server and > return them in a HTML page. This CGI works fine on quick SQLs. > > But when I try to run a sl

Re: Python IDE

2007-11-10 Thread TheFlyingDutchman
On Nov 3, 6:11 am, Simon Pickles <[EMAIL PROTECTED]> wrote: > Coming from a Visual Studio background, editing text files and using the > terminal to execute them offends my sensibilities :) YOu should take a look at Wing IDE Professional - www.wingware.com -- http://mail.python.org/mailman/lis

Re: shouldn't 'string'.find('ugh') return 0, not -1 ?

2007-10-31 Thread TheFlyingDutchman
On Oct 31, 8:11 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > string.find has always been kind of a wart in Python; that's why > they're getting rid of it. For testing for the presence of a > substring, use the in operator: Per the Python 3000 presentation given by Guido Van Rossum at PyCon Feb

Re: Python Windows Installation

2007-10-29 Thread TheFlyingDutchman
I finally gave up trying to install to c:\Python25 and went with the install to C:\. However, I tried to install a module called pywin32 (Python for Windows Extensions) and after recognizing that the Python installation was in C:\ and saying it would install to C:\LIB\SITE- PACKAGES, it would then

Re: Python Windows Installation

2007-10-25 Thread TheFlyingDutchman
On Oct 24, 11:22 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > >I am trying to install Python 2.5 on Windows XP. It installs into the > >root directory on C:\ instead of C:\Python25 which it shows by default >

Re: Python Windows Installation

2007-10-23 Thread TheFlyingDutchman
With C:\Python25 already existing, I tried to install to C: \Python25\Python25. It installed to C:\. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Windows Installation

2007-10-23 Thread TheFlyingDutchman
I manually created C:\Python25 the reran the install program. The installation program noted that C:\Python25 existed and asked me if I still wanted to install there. After I said yes it installed to C:\. -- http://mail.python.org/mailman/listinfo/python-list

Python Windows Installation

2007-10-23 Thread TheFlyingDutchman
I am trying to install Python 2.5 on Windows XP. It installs into the root directory on C:\ instead of C:\Python25 which it shows by default as what it plans to install to. Selecting D:\Python25 on a previous iteration put the exe in D:\ and did not create a Python25 directory. On the most recent i

global variables

2007-10-02 Thread TheFlyingDutchman
Does anyone know how the variables label and scale are recognized without a global statement or parameter, in the function resize() in this code: #!/usr/bin/env python from Tkinter import * def resize(ev=None): label.config(font='Helvetica -%d bold' % \ scale.get()) top = Tk(

Re: your opinion on book "Foundations of Python Network Programming"?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 2:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > i'm debating if i should buy this book. it received good reviews at > Amazon:http://tinyurl.com/24zvrf. but it was published in 2004 and > i'm afraid quite some materials might be outdated? any input? > > thanks, > > ke

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 1:09 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > That's because the tutor list doesn't offer a newsgroup. He was probably > just trying to get rid of you. > > Now at 98.75% ... Not sure if that's the reading on your trollmeter or on the meter that measures what percentage of your pos

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 12:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > >> Or bind resources of these pocket protectors that otherwise would lead to > >> answers for people that do seek enlightment... > > > I don't thi

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 12:45 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:29 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > One issue I have with this group and that I encountered many years ago > > in the Perl group is that there is no separate group >

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > Or bind resources of these pocket protectors that otherwise would lead to > answers for people that do seek enlightment... I don't think it would be correct to characterize my posts as not seeking enlightenment. I do also happen to voice my opinion which seems appropriate since this can be ch

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> > wrote: > > [snip] > > >In this case I asked it as part of the original question and it was > >ignored. I ha

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:21 am, "Francesco Guerrieri" <[EMAIL PROTECTED]> wrote: > On 9/28/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > On Sep 28, 10:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > This is like listening to a four-year-old torme

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 11:16 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 11:04:39 -0700, TheFlyingDutchman <[EMAIL PROTECTED]> > wrote: > > [snip] > > >In this case I asked it as part of the original question and it was > >ignored. I ha

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 10:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: > >>> Which of

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 10:01 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 28 Sep 2007 09:42:49 -0700, TheFlyingDutchman wrote: > > Which of the common languages have higher order functions and what is > > the syntax? > > C, C++, Pascal, Perl, PH

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 9:30 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > You said it was a most basic language feature. I still haven't heard > > anything that leads me to believe that statement is correct. What > > languages implemented decorators as a most basic language feature? > > I was talking a

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > Decorators are syntax sugar for higher order functions. Higher order > functions are a both a basic and a fundamental language feature, and > exist in many languages. The fact that you don't know this just > proves, once again, that you like to talk more than you like to learn. Which of the co

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
On Sep 28, 2:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > >> The fact that you compare and criticise the simple annotations like > >> static or abstract with the much more powerful decorator concept shows > >>

Re: Python 3.0 migration plans?

2007-09-28 Thread TheFlyingDutchman
> > The fact that you compare and criticise the simple annotations like > static or abstract with the much more powerful decorator concept shows > that, despite being the maintainer of a > soon-to-be-ruling-the-python-world Python 3 fork, lack understanding of > even the most basic language featur

Re: Python 3.0 migration plans?

2007-09-27 Thread TheFlyingDutchman
> > - Abstract Base Classes > http://www.python.org/dev/peps/pep-3119/> > I like how someone here characterized decorators - those silly @ things. They remind me of Perl. Not adding keywords for abstract and static is like Perl not adding a keyword for class. But I know all such additions a

Re: Python 3.0 migration plans?

2007-09-27 Thread TheFlyingDutchman
It seems that Python 3 is more significant for what it removes than what it adds. What are the additions that people find the most compelling? -- http://mail.python.org/mailman/listinfo/python-list

Re: An Editor that Skips to the End of a Def

2007-09-22 Thread TheFlyingDutchman
On Sep 20, 8:47 pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > How about in the case of MS Win? > Try Wing IDE at http://www.wingware.com. It can run and debug programs and has a free version. -- http://mail.python.org/mailman/listinfo/python-list

Re: newb: BeautifulSoup

2007-09-20 Thread TheFlyingDutchman
On Sep 20, 8:04 pm, crybaby <[EMAIL PROTECTED]> wrote: > I need to traverse a html page with big table that has many row and > columns. For example, how to go 35th td tag and do regex to retireve > the content. After that is done, you move down to 15th td tag from > 35th tag (35+15) and do regex

Re: about __str__

2007-09-20 Thread TheFlyingDutchman
I read here recently that the __str__ method of a list calls the __repr__ method of each of its members. So you need to add a __repr__ method to your class: class CmterIDCmts: def __init__(self,commiterID,commits): self.commiterID_=long(commiterID) self.commits_=long(commits)

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-19 Thread TheFlyingDutchman
2 On Sep 19, 5:08 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Terry Reedy" <[EMAIL PROTECTED]> wrote in message > > > This assumes that comparing versions of 1.5 is still relevant. As far as I > know, his patch has not been maintained to apply against current Python. > This tells me that no

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-19 Thread TheFlyingDutchman
On Sep 19, 5:08 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Terry Reedy" <[EMAIL PROTECTED]> wrote in message This is a little confusing because google groups does not show your original post (not uncommon for them to lose a post in a thread - but somehow still reflect the fact that it exists

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-19 Thread TheFlyingDutchman
On Sep 19, 8:54 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 19 Sep 2007 19:14:39 -0700, Paul Rubin wrote: > > > etc. is at best an excuse for laziness. > > What are you doing about solving the problem? Apart from standing on the > side-lines calling out "Get yer la

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-19 Thread TheFlyingDutchman
On Sep 19, 3:41 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 19 Sep, 03:09, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > > > > > How much faster/slower would Greg Stein's code be on today's > > processors versus CPython running on the processor

Re: Google and Python

2007-09-19 Thread TheFlyingDutchman
On Sep 19, 1:02 pm, Erik Jones <[EMAIL PROTECTED]> wrote: > is usually Apache at most sites? > > No an http server and application server are two different things. > An http server services requests of a web server those requests can > be for static files or for services of a local application

Re: Google and Python

2007-09-19 Thread TheFlyingDutchman
> Have you tried Google "google python". Turns up a lot of links for me. > I had done it on this newsgroup, but not google. I did find a pretty good link: http://panela.blog-city.com/python_at_google_greg_stein__sdforum.htm Which says: "A few services including code.google.com and google groups

Google and Python

2007-09-19 Thread TheFlyingDutchman
Around 2000 I heard that Google was using Python to some extent. Now I see that Guido Van Rossum works for them as well as Alex Martellis who has the title "Uber Technical Lead" which seems to imply some fairly heavy Python usage there. I was wondering what is done at Google with Python and which P

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-19 Thread TheFlyingDutchman
On Sep 19, 8:51 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Tue, 18 Sep 2007 18:09:26 -0700, TheFlyingDutchman wrote: > > How much faster/slower would Greg Stein's code be on today's processors > > versus CPython running on the proces

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-18 Thread TheFlyingDutchman
On Sep 2, 5:38 pm, "Eduardo O. Padoan" <[EMAIL PROTECTED]> wrote: > > No.http://www.artima.com/weblogs/viewpost.jsp?thread=211430 > > Ops, I meant:http://www.artima.com/forums/threaded.jsp?forum=106&thread=211200 > > --http://www.advogato.org/person/eopadoan/ > Bookmarks:http://del.icio.us/edcrypt

Re: Python 3K or Python 2.9?

2007-09-17 Thread TheFlyingDutchman
On Sep 17, 4:02 am, Steve Holden <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > >> The other half of the confusion is cleared up by considering that > >> Python methods are ordinary functions that don't magically "know" in > >> which &q

Re: Python 3K or Python 2.9?

2007-09-17 Thread TheFlyingDutchman
If you wanna know why the Renault Dauphine requires the driver to pull down on the rearview mirror in order to shift into reverse you simply need to open the hood and remove the engine and disassemble the transmission and you will see that it has no way of distinguishing a shift into third from a

Re: Python 3K or Python 2.9?

2007-09-17 Thread TheFlyingDutchman
> The other half of the confusion is cleared up by considering that > Python methods are ordinary functions that don't magically "know" in > which "class" context they are executing: they must be told via the > first parameter. > They can be told all they want by the compiler/runtime - implicitly

Re: Python 3K or Python 2.9?

2007-09-17 Thread TheFlyingDutchman
> > > > Hi, I'm new to Python, I don't even fully know the language, never done > a full project in Python. What's more, probably I'll never will. > But that's not the point, the point is I want YOU people to modify the > language you know in and out, the program with which you've done many > sys

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> If you look at the thread "parameter list notation" from ten days or so > ago, TheFlyingDutchman has forked Python and is working on a very special > new language, PIEthun 3.01B. > I for one am looking forward to seeing all > the very special features of PIEthun. It w

Re: How to Start

2007-09-13 Thread TheFlyingDutchman
On Sep 13, 2:59 pm, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >I've decided that Python is a language/environment I'd like to learn > (I've been a professional programmer for 45+ years), but I really don't > know where and how to start! I have a number of books - and am buying > some more

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > (Can you tell I'm currently forced to developing in Java? ;) (Which I'm > currently avoiding to do, by wasting my time on usenet.)) > Maybe you can sneak Jython into the mix. Just describe it as "this Java scripting language". -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > Isn't one of the main ideas behind python that it doesn't force you to > do (well, declare) anything? And by "ideas" I mean "design decisions". > Thats exactly what makes python great for prototyping; you just do it > and see if it works. As soon as you need to declare things you have to > cha

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
> > > Here is a link to a tutorial where Sun is talking about the this > > reference: > >http://java.sun.com/docs/books/tutorial/java/javaOO/thiskey.html > > That's a tutorial for getting you started, no reference > documentation or in-depth course. > Here's a FAQ item where they refer to it as I

Re: Python 3K or Python 2.9?

2007-09-13 Thread TheFlyingDutchman
Well I'm with Bruce Eckel - there shouldn't be any argument for the object in the class method parameter list. But since Python 3 was "code-named" 3000 (implying but not delivering big changes... I don't think it required big changes) and since it still has an explicit object parameter it's a given

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
> >>> Foo.bar(foo, "spam") > >>> foo.bar("spam") That looks like a case of "There's more than one way to do it". ;) The first form is definitely consistent with the method declaration, so there's a lot to be said for using that style when teaching people to make classes -> send self, rece

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 5:47 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > I am talking about how an author describes in English the "this" > > pointer/reference in their book on programming C++ or Java. > > > I do

Re: Coming from Perl

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just search

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 3:53 pm, Bjoern Schliessmann wrote: > TheFlyingDutchman wrote: > > In C++ and Java I don't believe "this" is ever referred to as an > > implicit function parameter. > > Oh yes, it is. All methods use it as a base address into instances. > Implici

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
> > "this" in C++ and Java is not shown in the parameter list, which was > what he was > complaining about. He wants > > class MyClass: > def SomeFunction(someParameter): >self.someParameter = someParameter > > not > > class MyClass: > def SomeFunction(self, someParame

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 4:40 am, Bjoern Schliessmann wrote: > Ivan Voras wrote: > > What does "self" have to do with an object model? It's an > > function/method argument that might as well be hidden in the > > compiler without ever touching the role it has (if not, why?). I > > agree that it's needless noise

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > python.exe test.py "\"abc def\" 123" > > import sys > commandLine = "".join(sys.argv[1:]) > > print commandLine > > gives: > > "abc def" 123 With the surrounding quotes you actually only need: commandLine = sys.argv[1] -- http://mail.python.org/mailman/listinfo/python-list

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
> > It seems that \" will retain the quote marks but then the spaces get > gobbled. > > But if you replace the spaces with another character: > > python.exe test.py \"abc#def\"#123 > > then: > > import sys > commandLine = "".join(sys.argv[1:]) > > prints commandLine.replace('#',' ') > > gives: >

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:33 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm passing command line parameters to my browser, I need to pass the > > complete command line as-is, for example

Re: Get the complete command line as-is

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 8:00 pm, wangzq <[EMAIL PROTECTED]> wrote: > Hello, > > I'm passing command line parameters to my browser, I need to pass the > complete command line as-is, for example: > > test.py "abc def" xyz > > If I use ' '.join(sys.argv[1:]), then the double quotes around "abc > def" is gone, but

Python 3K or Python 2.9?

2007-09-11 Thread TheFlyingDutchman
Python user and advocate Bruce Eckel is disappointed with the additions (or lack of additions) in Python 3: http://www.artima.com/weblogs/viewpost.jsp?thread=214112 -- http://mail.python.org/mailman/listinfo/python-list

Re: cpython list __str__ method for floats

2007-09-11 Thread TheFlyingDutchman
On Sep 11, 4:07 am, "[david]" <[EMAIL PROTECTED]> wrote: > returns poorly formatted values: > > >>>str(13.3) > '13.3' > >>>str([13.3]) > '[13.301]' > > [david] There is some difference in the way repr() and str() convert floats to strings: >>> a = 13.3 >>> print str(a) 13.3 >>> prin

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:55 pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman wrote: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: > >>>> http://cheesesho

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 8:02 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > >

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 7:12 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > http://cheeseshop.python.org/pypi/enum/> > > (Please preserve attribution lines so it's clear who wrote what.) > > > Looking at th

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
> > I'd like to know if the Cheeseshop package 'enum' is useful to > you. Any constructive feedback would be appreciated. > > http://cheeseshop.python.org/pypi/enum/> Looking at the documentation it looks excellent. But I don't understand the 0.4.2 version number, particularly when you refer

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 8, 9:52 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman a écrit : > > > > > On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > > >>Hi, > > >>I have the following class - > > >>class TestOutcomes: > >>

Re: Python syntax wart

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 4:45 am, Bjoern Schliessmann wrote: > TheFlyingDutchman wrote: > > It may be that a language that doesn't have a statement terminator > > (which can be end-of-line) needs a statement continuation symbol. > > Which language could that be? I can hardly imagine

Re: Python syntax wart

2007-09-10 Thread TheFlyingDutchman
On Sep 9, 11:20 pm, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > It may be that a language that doesn't have a statement terminator > (which can be end-of-line) needs a statement continuation symbol. > (Excluding languages like Lisp that have parentheses everywhere). Act

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > te

Re: Enum class with ToString functionality

2007-09-10 Thread TheFlyingDutchman
On Sep 10, 2:28 am, [EMAIL PROTECTED] wrote: > Hi, > > I have the following class - > > class TestOutcomes: > PASSED = 0 > FAILED = 1 > ABORTED = 2 > > plus the following code - > > testResult = TestOutcomes.PASSED > > testResultAsString > if testResult == TestOutcomes.PASSED: > te

Re: Python syntax wart

2007-09-09 Thread TheFlyingDutchman
It may be that a language that doesn't have a statement terminator (which can be end-of-line) needs a statement continuation symbol. (Excluding languages like Lisp that have parentheses everywhere). -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine the bool between the strings and ints?

2007-09-07 Thread TheFlyingDutchman
On Sep 7, 8:40 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a dictionary with settings. The settinfgs can be strings, ints > or bools. I would like to write this list dynamically to disk in a big > for loop, unfortunately the bools need to be written as 0 or 1 to the > config

Re: startswith( prefix[, start[, end]]) Query

2007-09-06 Thread TheFlyingDutchman
> Else, you could as well write your own testing function: > > def str_starts_with(astring, *prefixes): >startswith = astring.startswith >for prefix in prefixes: > if startswith(prefix): >return true >return false > What is the reason for startswith = astring.startswith

Re: Using wild character

2007-09-06 Thread TheFlyingDutchman
On Sep 6, 5:53 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 06 Sep 2007 20:48:31 -0300, Zentrader <[EMAIL PROTECTED]> > escribi?: > > > On Sep 6, 12:47 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > >> Maybe better the ``in`` operator for the '*string*' type. `str.find

Re: why should I learn python

2007-09-06 Thread TheFlyingDutchman
On Sep 6, 4:01 pm, windandwaves <[EMAIL PROTECTED]> wrote: > On Sep 7, 10:44 am, Torsten Bronger <[EMAIL PROTECTED]> > wrote: > > > > > Hallöchen! > > > Tom Brown writes: > > > [...] Python has been by far the easiest to develop in. Some > > > people might say it is not "real programming" because

Re: Using wild character

2007-09-05 Thread TheFlyingDutchman
On Sep 5, 10:00 pm, Sreeraj <[EMAIL PROTECTED]> wrote: > hi, > > I am a beginner in Python. I wish to know how can i filter a list of > strings using wild characters.ie > Lets say i have list countries = > ["india","africa","atlanta","artica","nigeria"]. I need only the list > of string starting w

Re: list index()

2007-09-04 Thread TheFlyingDutchman
> > I explain it by noting that list.index and dict.get serve totally > different purposes. The former returns the index given a value; the > latter returns a value given a key. And the former raises an exception if the value is not found, while the latter returns None if the value is not found.

Re: parameter list notation

2007-09-04 Thread TheFlyingDutchman
> > Perhaps you could move further discussions to comp.lang.piethun? > Fair enough. Will contain PIEthun discussion to the PIEthun mailing list and the aforementioned newsgroup once it is established. It suddenly dawned on me while rereading my defense of my use of the term "array" that I w

Re: parameter list notation

2007-09-04 Thread TheFlyingDutchman
On Sep 4, 1:53 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Mon, 03 Sep 2007 22:10:41 -0700, TheFlyingDutchman wrote: > > Well I did a search on "Python variable length arguments" and found a > > hit that seems to explain the *fields

Re: parameter list notation

2007-09-04 Thread TheFlyingDutchman
Steve, Ben, Duncan, Thanks for the replies. TFD -- http://mail.python.org/mailman/listinfo/python-list

Re: parameter list notation

2007-09-03 Thread TheFlyingDutchman
Well I did a search on "Python variable length arguments" and found a hit that seems to explain the *fields parameter: When you declare an argment to start with '*', it takes the argument list into an array. def foo(*args): print "Number of arguments:", len(args) print "Arguments are: ", args

parameter list notation

2007-09-03 Thread TheFlyingDutchman
I am trying to use a database written in Python called buzhug. In looking at some of the functions I see this prototype: def create(self,*fields,**kw): I am not clear on what the * and the ** are for or what they represent. Or, what are they referred to as so I can do a query for information

Re: Python is overtaking Perl

2007-09-03 Thread TheFlyingDutchman
> This chart is showing that amount of python programers is smaller every > year :( I saw an article maybe a year ago, regarding "best careers" that completely contradicted previous articles I had seen in years gone by. It said that the number of people in programming and related jobs would decli

Re: list index()

2007-09-03 Thread TheFlyingDutchman
> > Actually there was. The OP's claim > | There are a million situations where you can have an item not be in > | a list and it is not an exception situation. > > ...is just plain nonsense. zzbbaadd neither does understand exceptions > nor what they are used for in Python. An item not being in a

Re: list index()

2007-08-31 Thread TheFlyingDutchman
> > Fair enough, but that's a tutorial. It would be foolish to demand that a > tutorial be a complete reference for everything that can be done with a list. I wasn't demanding anything of the page. I was pointing out how I made the assumption there was no way to find out if a list has a value oth

Re: list index()

2007-08-30 Thread TheFlyingDutchman
On Aug 30, 9:06 pm, "Carsten Haese" <[EMAIL PROTECTED]> wrote: > On Thu, 30 Aug 2007 20:17:00 -0700, zzbbaadd wrote > > > Well IN was what I was looking for and would have saved this thread. > > However I don't believe IN showed up on the doc web page that has > > list methods, where I found index(