Re: Python less error-prone than Java

2006-06-04 Thread D H
Christoph Zwerschke wrote: > > See the following web page if you dont find it ;-) > http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html > The point of that is that it did fail. It threw an ArrayIndexOutOfBoundsException exception. But it was just luck that h

Re: Can Python format long integer 123456789 to 12,3456,789 ?

2006-06-01 Thread D H
A.M wrote: > Hi, > > Is there any built in feature in Python that can format long integer > 123456789 to 12,3456,789 ? Apparently you need to use the locale module. This is the example they give online to print a simple number with commas: import locale locale.setlocale(locale.LC_ALL, 'English

Re: C# equivalent to range()

2006-06-01 Thread D H
Neuruss wrote: > I'm sorry for asking about another language here, but since I only know > Python and I'm trying to write something in C#, I guess this is the > best place... > > I'd like to know how to write this in C#: > > x=[] > sz = 1000 > x.extend(range(sz)) > > My question is about "ra

Go "help" the perl list instead Fredrik Lundh

2006-05-25 Thread D H
Fredrik Lundh wrote: > vbgunz wrote: > >>> I have new a list , when it hava large number of values, I wonna to >>> delete all the values in it,how to do? >> >> something like this will probably help. >> >> x = [1,2,3,4,5,6,7,8,9] >> y = x >> >> list([x.pop() for z in xrange(len(x))]) >> >> print x

Re: John Bokma harassment

2006-05-24 Thread D H
Kay Schluehr wrote: > To make a witty comment: > Xah is the star, who undresses his mind. > But good and sensitive people don't like liking to > contribute in those nasty battles and believe their time is deserved to > something less wastefull. > I mildly disagree with attitude and tend to > t

Re: Python vs. Lisp -- please explain

2006-02-21 Thread D H
Donn Cave wrote: > I can say "Python can serve as a scripting language for some applications", > but not "Python is a scripting language!" bruno at modulix wrote: > as soon as you say "interpreted, scripting", peoples think "not > serious". Cameron Laird wrote: > I *think* you're proposing tha

Re: How to get started in GUI Programming?

2005-12-23 Thread D H
Kay Schluehr wrote: > [EMAIL PROTECTED] wrote: > >>I am trying to learn GUI programming in Python, but have to confess I >>am finding it difficult. > > > Don't do it if you can prevent it. What kind of helpful advice is that? > Conclusion: if you are already familiar with BASIC I would just >

Re: What is unique about Python?

2005-12-23 Thread D H
Kay Schluehr wrote: > gsteff wrote: > > >>So I'm wondering, what is >>innovative about Python, either in its design or implementation? Or is >>its magic really just in combining many useful features of prior >>languages in an unusually pleasant way? >> >>Greg > > > The latter. > > http://www.

Re: simple question on optional parameters

2005-12-12 Thread D H
[EMAIL PROTECTED] wrote: > I am using a toolkit that has a SetFaveNumbers() method. the method > accepts any number > of comma-separated numbers. > > the following are all valid examples: > > FooToolkit.SetFaveNumbers(1,3,5) > FooToolkit.SetFaveNumbers(2,4,6,8,10) > FooToolkit.SetFaveNumbers(1) >

Re: Great books on Python?

2005-12-11 Thread D H
Tolga wrote: > I am not unfamiliar to programming but a newbie in Python. Could you > recommend me (a) great book(s) to start with? Free online books or > solid books are welcome. > http://www.ibiblio.org/g2swap/byteofpython/read/index.html http://www.ibiblio.org/obp/thinkCSpy/ http://www.freene

Re: OO in Python? ^^

2005-12-11 Thread D H
Fredrik Lundh wrote: > Write code, not usenet posts. QOTW! -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread D H
Fredrik Lundh wrote: > Zeljko Vrba wrote: > > >>But look at the following example: >> >>if a: >> some_code1 >>if b: >> some_code2 >> >>If I accidentaly delete if b:, then some_code2 gets under the if a: which is >>not intended. > > > not to mention that if you have > > if a: > so

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-07 Thread D H
[EMAIL PROTECTED] wrote: > Some people like it just as it is. Don't change ANYTHING! search for NIMPY > Some people (a lot of the ones that don't give Python a chance) want > one more choice, braces. Is that so much to ask for? If you like curly brace style, there are always other scripting l

Re: Documentation suggestions

2005-12-06 Thread D H
Ian Bicking wrote: >>There are endless minor bugs in the library reference, but that seems >>unavoidable. It documents many different and shifting modules, and >>what to document is itself a contentious issue, so I don't think the >>stream of small problems will ever cease. > > > Since the topic

Re: iron python exe problem

2005-12-06 Thread D H
Dennis Lee Bieber wrote: > On 6 Dec 2005 08:25:43 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>Hello, >> >>I run exactly inside IronPython-0.9.5\bin where IronPython.dll exist. >>I've already uninstalled my .net 1.1 so there is onle .net 2.0

Re: i=2; lst=[i**=2 while i<1000]

2005-12-06 Thread D H
[EMAIL PROTECTED] wrote: >>You can use i**=2 for i in range(1000) instead > > > I don't think one can use assignment in list comprehension or generator > expression. The limitation is very much like lambda. > i**2 -- http://mail.python.org/mailman/listinfo/python-list

Re: iron python exe problem

2005-12-06 Thread D H
[EMAIL PROTECTED] wrote: > Hello, > > I have test.py: > print 'hello' > > I compile using iron python the result is test.exe > > I have got error message when I tried to call test.exe telling that > test.exe is not a valid win32 application. > > How can I solve this problem? > > Sincerely Your

Re: i=2; lst=[i**=2 while i<1000]

2005-12-06 Thread D H
Daniel Schüle wrote: > Hello NG, > > I am wondering if there were proposals or previous disscussions in this > NG considering using 'while' in comprehension lists > > # pseudo code > i=2 > lst=[i**=2 while i<1000] > > of course this could be easily rewritten into > i=2 > lst=[] > while i<1000:

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread D H
Rick Wotnaz wrote: > So, for instance, even a single character (like an opening or > closing bracket or a semicolon) is an indication that the design > can be improved. Or a colon -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-03 Thread D H
Scott David Daniels wrote: > Tom Anderson wrote: >> So, could someone explain what's so evil about tabs? > > > They appear in different positions on different terminals (older hard- > copy), do different things on different OS's, and in general do not > behave nicely. On many (but not all) syste

Re: Underscores in Python numbers

2005-11-20 Thread D H
Steve Holden wrote: > David M. Cooke wrote: >> One example I can think of is a large number of float constants used >> for some math routine. In that case they usually be a full 16 or 17 >> digits. It'd be handy in that case to split into smaller groups to >> make it easier to match with tables whe

Re: about python ide

2005-11-13 Thread D H
?? wrote: > i am use python2.4.2 on my gentoo linux system > i want to find some ide of python > but i am using gtk2.8,wxPython has some bug on it.i cant emerge it correctly. > i want some ide use pygtk or other lib of python gui except > wxpython(wxWidgets) Try Gazpacho or Glade for designing yo

Re: How to avoid "f.close" (no parens) bug?

2005-11-13 Thread D H
Carsten Haese wrote: > On Thu, 2 Nov 2006 23:56:22 +0200, o wrote > >>plez send me >> > > > Please tell us what bug you're talking about: > > A) Python closed the file but you expected it not to. > B) Python didn't close the file but you expected it to. > C) Python didn't warn you when you w

Re: want some python ide

2005-11-13 Thread D H
[EMAIL PROTECTED] wrote: > i want some python ide use pygtk > eric3 is good for me ,but i like gtk,so i want some pygtk ide look like > eric3 > wing is a good python ide,but i can not download it > some other python ide(must use pygtk) > thx > You can just use a text editor like jedit with gazpac

Re: Hi All - Newby

2005-10-26 Thread D H
Ask wrote: > > I found a link to this newsgroup, downloaded 1000 messages, You might check out the python-tutor list if you have beginner questions: http://mail.python.org/mailman/listinfo/tutor > I must admit to much confusion regarding some of the basics, but I'm sure > time, reading, and

Re: NEWBIE

2005-10-26 Thread D H
[EMAIL PROTECTED] wrote: > brenden wrote: > >>hey everyonei'm new to all this programming and all this stuff and >>i just wanted to learn how to do it... >> >>does anyone think they can teach me how to work with python? > > > Don't waste readers' time with such vague and broad requests. Inst

Re: more than 100 capturing groups in a regex

2005-10-26 Thread D H
Fredrik Lundh wrote: > Joerg Schuster wrote: > > >>>if you want to know why 100 is a reasonable and non-random choice, I >>>suggest checking the RE documentation for "99 groups" and the special >>>meaning of group 0. >> >>I have read everything I found about Python regular expressions. But I >>am

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-04 Thread D H
Istvan Albert wrote: > Disclaimer: this is not a flame against Boo. > > It just boggles my mind that a language that describes itself as > "python inspired syntax" keeps being touted as: > > >>Luis M. Gonzalez wrote: >>Boo (which could be considered almost an static version of Python for .NET) >

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-03 Thread D H
spiffo wrote: > Ok, I LOVE python, so that is not the issue, but, I am getting very worried > about it's growth. I recently re-visted the web looking at alot of projects > I assumed would be up and running by now from over a year ago, such as Boa > Constructor, Iron Python etc... it seems all these

Re: Parrot & Python ?

2005-10-02 Thread D H
Do Re Mi chel La Si Do wrote: > Hi ! > > On the site of Amber : http://xamber.org/index.html > We can to view the sentence : "Parrot version of Python" > Question : what is "Parrot version of Python" ? > Parrot is a virtual machine runtime, like the java vm or .NET CLR. http://www.parrotcode.o

Re: "no variable or argument declarations are necessary."

2005-10-02 Thread D H
James A. Donald wrote: > I am contemplating getting into Python, which is used by engineers I > admire - google and Bram Cohen, but was horrified to read > > "no variable or argument declarations are necessary." > > Surely that means that if I misspell a variable name, my program will > mysteriou

Grant Edwards [Re: cElementTree clear semantics]

2005-09-25 Thread D H
Grant Edwards wrote: > On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: > > >>>>I would recommend emailing the author of a library when you >>>>have a question about that library. You should know that >>>>yourself as well. >>> >>

Re: cElementTree clear semantics

2005-09-25 Thread D H
Fredrik Lundh wrote: > Paul Boddie wrote: > > >>Regardless of anyone's alleged connection with Boo or newsgroup >>participation level, the advice to contact the package >>author/maintainer is sound. It happens every now and again that people >>post questions to comp.lang.python about fairly speci

Re: cElementTree clear semantics

2005-09-25 Thread D H
Grant Edwards wrote: > On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: > >>>>Igor V. Rafienko wrote: >>>> >>>> >>>>>This gave me the desired behaviour, but: >>>>> >>>>>* It looks *very* ugly >>&

Fredrik Lundh [Re: Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]]

2005-09-25 Thread D H
Fredrik Lundh wrote: > Doug Holton wrote: > > >>You're the only one making any association between this thread about >>celementree and boo. > > > really? judging from the Original-From header in your posts, your internet > provider is sure making the same association... You seriously need som

Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>Reinhold Birkenfeld wrote: >> >>>D H wrote: >>> >>> >>>>D H wrote: >>>> >>>> >>>>>Reinhold Birkenfeld wrote: >>>>> >>>>> >

Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>D H wrote: >> >>>Reinhold Birkenfeld wrote: >>> >>> >>>>Well, if I had e.g. a question about Boo, I would of course first ask >>>>here because I know the expert writes here. >&g

Reinhold Birkenfeld [was "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
D H wrote: > Reinhold Birkenfeld wrote: > >> >> Well, if I had e.g. a question about Boo, I would of course first ask >> here because I know the expert writes here. >> >> Reinhold > > > Reinhold Birkenfeld also wrote: > > If I had wanted to sa

Re: cElementTree clear semantics

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > > Well, if I had e.g. a question about Boo, I would of course first ask > here because I know the expert writes here. > > Reinhold Reinhold Birkenfeld also wrote: > If I had wanted to say "you have opinions? fuck off!", I would have said >"you have opinions? fuck

Re: cElementTree clear semantics

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>Igor V. Rafienko wrote: >> >>>This gave me the desired behaviour, but: >>> >>>* It looks *very* ugly >>>* It's twice as slow as version which sees 'end'-events only. >>> &g

Re: cElementTree clear semantics

2005-09-25 Thread D H
Igor V. Rafienko wrote: > This gave me the desired behaviour, but: > > * It looks *very* ugly > * It's twice as slow as version which sees 'end'-events only. > > Now, there *has* to be a better way. What am I missing? > Try emailing the author for support. -- http://mail.python.org/mailman/lis

Re: Django Vs Rails

2005-09-25 Thread D H
Jaroslaw Zabiello wrote: > Dnia 24 Sep 2005 22:48:40 -0700, [EMAIL PROTECTED] napisał(a): > > >>You should give TurboGears a try. > > This project is good only for fun and playing not for enterprise. That's my kind of project :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternatives to Stackless Python?

2005-09-22 Thread D H
[EMAIL PROTECTED] wrote: > After recently getting excited about the possibilities that stackless > python has to offer > (http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/) > and then discovering that the most recent version of stackless > available on stack

Re: Why doesn't IDLE editor windows have horizontal scrollbars?

2005-09-17 Thread D H
chuck wrote: > Well I don't want to start yet another thread on IDE's. I've googled > and all of that an am aware of most of the IDE's that are out there. I > am curious if there is someplace where statistics have been captured on > what IDE's most people are using. Since IDLE ships with Python

Re: Rendering HTML

2005-09-16 Thread D H
Harlin Seritt wrote: > I am looking for a module that will render html to console but > formatted much like one might see with Lynx. Is there such a module > already out there for this? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52297 -- http://mail.python.org/mailman/listinfo/python

Re: multiple replaces

2005-09-16 Thread D H
You can use python's re.sub function. But also look into full fledged template engines like Cheetah. import re txt=""" whatever the machine with bing 10% of boo is foo """ h1=txt.replace("%","%%") h3 = re.sub("", "%(\\1)s", h1) house="something awfull" tree="something beautifull" print h3

Re: Python linear algebra module -- requesting comments on interface

2005-09-10 Thread D H
Terry Reedy wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>The module will be public domain. > > > Various lawyers have suggested that either you cannot do that (is US) or > that you should not do that. (You know the joke -- ask two lawyers and you > get three opi

Re: Django Vs Rails

2005-09-06 Thread D H
bruno modulix wrote: > D H wrote: > > (snip) > >>Go with Rails. Django is only like a month old. > > > Please take time to read the project's page. Django has in fact three > years of existence and is already used on production websites, so it&#x

Re: Replacement for lambda - 'def' as an expression?

2005-09-06 Thread D H
talin at acm dot org wrote: > I've been reading about how "lambda" is going away in Python 3000 (or See the page built from earlier threads about this: http://wiki.python.org/moin/AlternateLambdaSyntax Your syntax is the same used in boo: http://boo.codehaus.org/Closures -- http://mail.python.or

Re: Django Vs Rails

2005-09-06 Thread D H
flamesrock wrote: > D H, > 'flamesrock' refers to the Calgary Flames, not the act of flaming. > It was just a joke about your statement and your name. I thought it was obvious enough that a smiley wasn't necessary. I don't care though, flames happen on comp.lang

Re: Django Vs Rails

2005-09-05 Thread D H
flamesrock wrote: > Firstly, this topic is NOT intended for trolling or starting any flame > wars. Whatever you say, "flamesrock". -- http://mail.python.org/mailman/listinfo/python-list

Re: 'isa' keyword

2005-09-05 Thread D H
Colin J. Williams wrote: > Could you elaborate on that please? See my earlier post in this thread, this link: http://www.canonical.org/~kragen/isinstance/ -- http://mail.python.org/mailman/listinfo/python-list

Re: 'isa' keyword

2005-09-01 Thread D H
talin at acm dot org wrote: > Although I realize the perils of even suggesting polluting the Python > namespace with a new keyword, I often think that it would be useful to > consider defining an operator for testing whether or not an item is a > member of a category. It's a good idea but not like

Re: The ONLY thing that prevents me from using Python

2005-08-24 Thread D H
Paul Rubin wrote: > Richie Hindle <[EMAIL PROTECTED]> writes: > >>I can't speak for linode.org, but I have a Xen VPS from rimuhosting.com >>and it's early days but so far I've been very impressed. It's $19/mo >>(normally $20 but they kindly gave me a 5% Open Source Developer discount) > > > Do

Re: Sandboxes

2005-08-22 Thread D H
42 wrote: > Or is this a hopeless cause? > > Finally, either way, would anyone recommend a different script engine > that might be more suitable for what I'm trying to accomplish that I > might not have looked at. I don't need much; it needs to work with C#, > and be able to easily interact wi

Re: loop in python

2005-08-22 Thread D H
km wrote: > Hi all, > > Why is it that the implementation of empty loop so slow in python when > compared to perl ? > > #i did this in python (v 1.5) > for x in xrange(1000): > print x > # this took 0.017 seconds > -- > #similar code in perl (v 5.6): > for $x (0..1

Re: Python's Exception, and Capitalization

2005-08-12 Thread D H
Ray wrote: > Hello guys, > > OK, I've been reading some more about Python. There are some things > about Python exception that I haven't been able to grasp: > > 1. This is a small thing, but why is object spelled "object", and the > mother of all exception "Exception" (with capital E)? Why is not

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-06 Thread D H
[EMAIL PROTECTED] wrote: > I'm not saying 'modulescope' and 'module' are the only alternatives or > even > the best anyone can come up with. > > 'global' has the connotation of being visible *EVERYWHERE* > where in Python it is just visible in one module's space. > > Can you think of a better alt

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread D H
[EMAIL PROTECTED] wrote: > I've heard 2 people complain that word 'global' is confusing. > > Perhaps 'modulescope' or 'module' would be better? > > Am I the first peope to have thought of this and suggested it? > > Is this a candidate for Python 3000 yet? It is likely that more people would fin

Re: The ONLY thing that prevents me from using Python

2005-08-05 Thread D H
I would highly recommend user-mode linux (UML) hosting, like bytemark or Linode: http://user-mode-linux.sourceforge.net/uses.html Starting around the same price as average shared hosting, you get your own virtual linux box (i recommend debian), on which you can install java, mod_python, php, mo

Re: A replacement for lambda

2005-07-30 Thread D H
Mike Meyer wrote: > Rewriting a canonical abuse of lambda in this idiom gives: > > myfunc = def @(*args): > return sum(x + 1 for x in args) Nice proposal. Technically you don't need the @ there, it is superfluous. But then again so is the colon, so whatever floats your boat. > c

Re: Rich Graphics?

2005-07-27 Thread D H
Cairo is an option, for Linux only though at the moment. There is a python binding: http://cairographics.org/bindings You can use it in combination with pygtk: http://cvs.cairographics.org/pycairo/examples/svg/ See also the backends used by matplotlib, a python plotting module. -- http://mail.py

Re: goto

2005-07-18 Thread D H
Mike Meyer wrote: > rbt <[EMAIL PROTECTED]> writes: > >>Many of the world's most profitable software companies (MS for example) >>have thousands of goto statements in their code... oh the horror of it >>all. Why aren't these enlightened-by-the-gods know-it-alls as profitable >>as these obviously i

Re: HTML expect in python

2005-07-15 Thread D H
WGW wrote: > I would like to automate some simple browser navigating using python. > Ideally, I would like a package like pyexpect, but that can handle a > browser in much the same way as pyexpect handles a terminal (tall > order!). In short, I want a macro language for a browser (I know about

Re: f*cking re module

2005-07-04 Thread D H
Gustavo Niemeyer wrote: > That's what I love in that news group. Someone comes with a > stupid and arrogant question, and someone else answers in a > calm and reasonable way. ...and then someone else comes along and calls the first person stupid and arrogant, which is deemed QOTW. :) -- http://m

Re: Which kid's beginners programming - Python or Forth?

2005-06-27 Thread D H
BORT wrote: > So, that said... In ~simplest~ terms for the stated goal -- Forth or > Python? > ...the goal is NOT the spelling tutor... it is learning how to use a > tool to solve a problem. I am asking which tool is more suited to an > otherwise arbitrary direction of "spelling tutor program."

Re: Thoughts on Guido's ITC audio interview

2005-06-25 Thread D H
Dave Benjamin wrote: > One thing Guido mentions in his comparison of ABC (Python's predecessor) and > Python is how ABC was inextricably tied to its environment (a la Smalltalk), What surprised me was that this was the only thing he really mentioned. He didn't mention anything about the the

Re: A strange and annoying restriction, possibly a bug. A glance by a more experienced would be nice.

2005-06-25 Thread D H
Elmo Mäntynen wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This is the case: > > n=(100,) tuple(*n) > > > Traceback (most recent call last): > File "", line 1, in -toplevel- > tuple(*n) > TypeError: iteration over non-sequence The star (*n) means you are essentially

Re: Favorite non-python language trick?

2005-06-24 Thread D H
Terry Reedy wrote: > "Tom Anderson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>sometimes in python. No, it's not really possible in a typeless language, >>and yes, there are implementations based on decorators, but frankly, >>they're awful. > > > Python has strongly ty

Re: Favorite non-python language trick?

2005-06-24 Thread D H
Terry Reedy wrote: > "D H" <[EMAIL PROTECTED]> wrote in message > > >>Roy Smith wrote: > > >>>Tom Anderson <[EMAIL PROTECTED]> wrote: >>> >>>>The one thing i really do miss is method overloading by parameter >>>

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-24 Thread D H
Steven D'Aprano wrote: > On Fri, 24 Jun 2005 12:54:34 -0500, D H wrote: > > >>Riccardo Galli wrote: >> >>>On Fri, 24 Jun 2005 09:00:04 -0500, D H wrote: >>> >>> >>> >>>>>Bo Peng wrote: >>>>> >>>&

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-24 Thread D H
Riccardo Galli wrote: > On Fri, 24 Jun 2005 09:00:04 -0500, D H wrote: > > >>>Bo Peng wrote: >>> >>> >>>>I need to pass a bunch of parameters conditionally. In C/C++, I can >>>>do func(cond1?a:b,cond2?c:d,.) >>>> >>

Re: Favorite non-python language trick?

2005-06-24 Thread D H
Roy Smith wrote: > Tom Anderson <[EMAIL PROTECTED]> wrote: > >>The one thing i really do miss is method overloading by parameter >>type. I used this all the time in java > > > You do things like that in type-bondage languages like Java and C++ > because you have to. Can you give an example of

Re: Favorite non-python language trick?

2005-06-24 Thread D H
infidel wrote: >>def class Colour: >>def __init__(self, blue=0, green=0, red=0): >># pseudo-Python code borrowing concept "with" from Pascal >>with self: >>blue = blue >>green = green >>red = red >> >>And now you can see why Python doesn't sup

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-24 Thread D H
Dave Brueck wrote: > Please keep the discussion civil; please help keep c.l.py a nice place > to visit. You didn't see Peter Hansen's previous post to which I made my reply, so I'd like to extend your recommendation to *everyone* here. Peter Hansen wrote: > Doug, please stop making an idiot of

Re: Favorite non-python language trick?

2005-06-24 Thread D H
Joseph Garvin wrote: > I'm curious -- what is everyone's favorite trick from a non-python > language? And -- why isn't it in Python? You can try out new features yourself now using various python extensions or descendants: http://livelogix.net/logix/ - macros, no statement/expression distinc

Re: webserver application (via Twisted?)

2005-06-24 Thread D H
flupke wrote: > I need to program and setup serveral webservices. > If i were still using jsp, i would use Tomcat to make the several > applications available on a given port. > How can i accomplish this in Python? > I was thinking about Twisted but it's not clear to me what parts i need > to make

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-24 Thread D H
Peter Hansen wrote: > D H wrote: > >> Peter Hansen wrote: >> >>> Bo Peng wrote: >>> >>>> I need to pass a bunch of parameters conditionally. In C/C++, I can do >>>> func(cond1?a:b,cond2?c:d,.) >>>> >>>> Is th

Re: calling subclass constructor question

2005-06-19 Thread D H
In Han Kang wrote: > So each of the sub classes plots a different type of graph. The > superclass defines methods that are the same for all the plots. I want > to be able to pick some points and be able to generate a more plots. > What I was wondering if I could define in a method in the supe

Re: Loop until condition is true

2005-06-19 Thread D H
Joseph Garvin wrote: > Peter Otten wrote: > >> I found 136 occurrences of "do {" versus 754 of "while (" and 1224 of >> "for >> (" in the Python 2.4 source, so using these rough estimates do-while >> still >> qualifies as "rarely used". >> >> Peter >> >> >> > That's 136 times you'd have to use

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-19 Thread D H
Peter Hansen wrote: > Bo Peng wrote: > >> I need to pass a bunch of parameters conditionally. In C/C++, I can do >> func(cond1?a:b,cond2?c:d,.) >> >> Is there an easier way to do this in Python? > > > Please read the FAQ to learn the answer and much other useful ... The answer is no. Use i

Re: case/switch statement?

2005-06-19 Thread D H
Peter Hansen wrote: > D H wrote: > >> Peter Hansen wrote: > > [some stuff Doug didn't like] > Actually, this is what you snipped, stuff you didn't like, because the very mention of "boo" causes you such fits: > Since you and Steve Holden agree t

Re: What is different with Python ?

2005-06-19 Thread D H
Peter Hansen wrote: > D H wrote: >> So you say he "has done relatively little serious development" and >> that he may not even know about Python. I didn't see any evidence >> from those pages to draw either conclusion. In fact the 4th paragraph >> qu

Re: Back to the future - python to C++ advice wanted

2005-06-17 Thread D H
George Sakkis wrote: > During the last 18 months or so I have indulged in the joy of learning > and using python for almost everything, but I may have to go back to > C/C++ at work. Suddenly I found myself transliterating (or translating > at least) common python idioms and patterns, looking for li

Re: What is different with Python ?

2005-06-17 Thread D H
Peter Hansen wrote: >> But apparently some guru I greatly respect thinks so >> (I'm not kidding, http://www.spellen.org/youcandoit/). > > > With respect to the author, and an understanding that there is probably > much that didn't go into his self-description (add "about.htm" to the > above URL

Re: case/switch statement?

2005-06-17 Thread D H
Peter Hansen wrote: > D H wrote: > >> Peter Hansen wrote: >> >>> With a case statement, on the other hand, you *know* that it must be >>> just simple conditionals (a series of x == some_constant tests), so >>> you don't need to look at a

Re: What is different with Python ?

2005-06-13 Thread D H
Andrea Griffini wrote: > On Mon, 13 Jun 2005 22:23:39 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > >>Being familiar with >>fondamental *programming* concepts like vars, branching, looping and >>functions proved to be helpful when learning C, since I only had then to >>focus on p

Re: What is different with Python ?

2005-06-13 Thread D H
Andrea Griffini wrote: > On Sat, 11 Jun 2005 21:52:57 -0400, Peter Hansen <[EMAIL PROTECTED]> > wrote: > > >>I think new CS students have more than enough to learn with their >>*first* language without having to discover the trials and tribulations >>of memory management (or those other things

Re: What is different with Python ?

2005-06-13 Thread D H
Philippe C. Martin wrote: > Yet for the first time I get (most) of my questions answered by a language I > did not know 1 year ago. ^^ You're in the Python honeymoon stage. -- http://mail.python.org/mailman/listinfo/python-list

Re: The need to put "self" in every method

2005-06-13 Thread D H
Steve Holden wrote: > Fernando M. wrote: > >> Hi, >> >> i was just wondering about the need to put "self" as the first >> parameter in every method a class has because, if it's always needed, >> why the obligation to write it? couldn't it be implicit? >> >> Or is it a special reason for this being

Re: case/switch statement?

2005-06-13 Thread D H
Peter Hansen wrote: > With a case statement, on the other hand, you *know* that it must be > just simple conditionals (a series of x == some_constant tests), so you > don't need to look at all the cases, just the one that interests you. Since you and Steve Holden agree that a case statement is u

Re: Best Web dev language

2005-06-11 Thread D H
Jon Slaughter wrote: > I'm trying to get into web development for creating a professional web site > and I'm confused on which language I should use. I've read some comparisons > between the major languages and I was thinking that python might be the way > to go for the most powerful and genera

Re: Case Sensitive, Multiline Comments

2005-05-30 Thread D H
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, D H <[EMAIL PROTECTED]> wrote: > > >>Elliot Temple wrote: >> >>>Hi I have two questions. Could someone explain to me why Python is >>>case sensitive? I find that annoying. >> >&

Re: Case Sensitive, Multiline Comments

2005-05-29 Thread D H
Elliot Temple wrote: > Hi I have two questions. Could someone explain to me why Python is > case sensitive? I find that annoying. I do too. As you've found, the only reason is because it is, and it is too late to change (it was even too late back in 1999 when it was considered by Guido). I

Re: Fredrik Lundh

2005-05-08 Thread D H
Robert Kern wrote: > The Daily Python-URL isn't obligated to link to *anything*. I never suggested it was. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fredrik Lundh

2005-05-08 Thread D H
Sakesun Roykiattisak wrote: > IMHO, Pythonware.com does not have to be about python. It can be > anything the maintainer want it to be. > > Get the point ? You successfully repeated my own argument, so yes, I get the point. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fredrik Lundh

2005-05-08 Thread D H
Robert Kern wrote: > It's called Daily Python-URL not Daily Python-Like-Languages-URL. *That* > explains it. google for logix site:pythonware.com He's announced plenty non-python stuff that is of interest to python users, including plenty of marketing for his own software. > It's not like Py

Fredrik Lundh

2005-05-08 Thread D H
Fredrik Lundh wrote: > "D H" <[EMAIL PROTECTED]> wrote: > > >>>Why do you think you need a regular expression? >>> >>>If another approach that involved no regular expressions worked much >>>better, would you reject it for some rea

Re: How to write this regular expression?

2005-05-05 Thread D H
Peter Hansen wrote: > could ildg wrote: > >> I need a regular expression to check if a string matches it. > > > Why do you think you need a regular expression? > > If another approach that involved no regular expressions worked much > better, would you reject it for some reason? > > -Peter A

Re: How To Reply

2005-05-05 Thread D H
phil wrote: > I get a digest several times a day. > When I wish to respond to an item I must > cut and paste the item and the subject line. > Is there something to click on for a simple reply? > Using an old mozilla mail. > Thanks > Perfectly valid question. Add an nntp connection in mozilla mail

  1   2   >