Re: Accessing class variable at class creation time

2005-09-26 Thread Dave Hansen
On 23 Sep 2005 14:01:21 -0700, "Carlos" <[EMAIL PROTECTED]> wrote: >Hi! > >class A: > X = 2 > def F(): >print A.X > F() > >The above fails because the name A is not >yet at global scope when the reference A.X Maybe I'm missing something. Python 2.4.1#65 under Win32 Idle 1.1.1 gives me the

Re: New Python chess module

2005-09-30 Thread Dave Hansen
On Sat, 01 Oct 2005 06:27:01 +1000, Tim Churches <[EMAIL PROTECTED]> wrote: >Will McGugan wrote: >> There is a new version if anyone is interested... >> >> http://www.willmcgugan.com/chess.py >> >> It contains optimizations and bugfixes. >> >> Can anyone suggest a name for this module? pyChess

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Dave Hansen
On Fri, 07 Oct 2005 14:24:42 -, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2005-10-07, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >> >> "Some village in Texas are missing their idiot" > >At least that one is consistent, though it sounds "wrong" to US >ears. The Germans have a word for it

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Dave Hansen
On Fri, 07 Oct 2005 21:44:29 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: >Terry Hancock wrote: >> On Friday 07 October 2005 03:01 am, Steve Holden wrote: >> >>>OK, so how do you account for the execresence "That will give you a >>>savings of 20%", which usage is common in America? >> >> >>

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-07 Thread Dave Hansen
On Fri, 7 Oct 2005 16:18:57 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >On Friday 07 October 2005 01:31 pm, Dave Hansen wrote: Actually, I didn't, though I did respond to it. Please watch your attributions. Thanks, -=Dave -- Change is inevit

Re: dictionaries/pointers

2005-10-07 Thread Dave Hansen
On 7 Oct 2005 14:23:49 -0700, "Rob Conner" <[EMAIL PROTECTED]> wrote: >I dont know how to do this and can't think of a simple way to. > >All I want is a dictionary where two keys point to the same object. >(to steal the ascii art from >http://starship.python.net/crew/mwh/hacks/objectthink.html) >I

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-10 Thread Dave Hansen
On Mon, 10 Oct 2005 16:42:34 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >On Sunday 09 October 2005 07:50 am, phil hunt wrote: >> On Fri, 7 Oct 2005 01:05:12 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >> >GvR's syntax has the advantage of making grammatical sense in English (i.e. >> >read

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-12 Thread Dave Hansen
On Tue, 11 Oct 2005 01:06:30 -0400, "George Sakkis" <[EMAIL PROTECTED]> wrote: >"Dave Hansen" <[EMAIL PROTECTED]> wrote: > >> On Mon, 10 Oct 2005 16:42:34 -0500, Terry Hancock >> <[EMAIL PROTECTED]> wrote: >> >> >On Sunday 09

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-12 Thread Dave Hansen
On Wed, 12 Oct 2005 13:02:20 +0200, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >> Paul Rubin (PR) wrote: > [...] > >>PR> Yeah, "if C then A else B" is a ancient tradition stretching from >>PR> Algol-60 to OCAML, and who knows what all else in between. I'm not >>PR>

Re: Jargons of Info Tech industry

2005-10-12 Thread Dave Hansen
On Wed, 12 Oct 2005 21:44:22 GMT, Roedy Green <[EMAIL PROTECTED]> wrote: [...] >Obviously you can't trust anything code-like that arrives from >strangers. It is an extension of the law Mommy laid down not to take >candy from strangers. > >However, formatted text is not code. Pictures are not code.

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-13 Thread Dave Hansen
On Thu, 13 Oct 2005 21:49:15 +0200, Piet van Oostrum <[EMAIL PROTECTED]> wrote: >>>>>> [EMAIL PROTECTED] (Dave Hansen) (DH) wrote: > >>DH> So lose the "if." > >>DH>R = C then A else B > >>DH> I don't think python use

Re: Underscores in Python numbers

2005-11-08 Thread Dave Hansen
On 7 Nov 2005 18:02:09 -0800 in comp.lang.python, "Gustav Hållberg" <[EMAIL PROTECTED]> wrote: >I tried finding a discussion around adding the possibility to have >optional underscores inside numbers in Python. This is a popular option >available in several "competing" scripting langauges, that I

Re: is parameter an iterable?

2005-11-15 Thread Dave Hansen
On 15 Nov 2005 11:26:23 -0800 in comp.lang.python, "py" <[EMAIL PROTECTED]> wrote: >Dan Sommers wrote: >> Just do it. If one of foo's callers passes in a non-iterable, foo will >> raise an exception, and you'll catch it during testing > >That's exactly what I don't want. I don't want an exceptio

Re: Reinvent no more forever

2005-11-18 Thread Dave Hansen
On 17 Nov 2005 18:06:55 -0800 in comp.lang.python, "Phillip J. Eby" <[EMAIL PROTECTED]> wrote: [...] > >Okay, so call yours "SuperEnum" or "PowerEnum" or "UltraEnum" or >"BetterEnum", "Enum-O-Matic", "Symbolitron"... ITYM "EnumOMatic" or "Enum_O_Matic". "Enum-O-Matic" is a syntax error. Or wors

Re: How to do "new_variable = (variable) ? True : False; " (php) on python?

2005-11-18 Thread Dave Hansen
On Fri, 18 Nov 2005 14:15:06 -0800 in comp.lang.python, Scott David Daniels <[EMAIL PROTECTED]> wrote: > > >Don't try to force everything to the type you expect, >use things as they are; embrace duck-typing. > Wrong, the grammar you have. Do not Everything to the type you expect force. Do or do n

Re: Underscores in Python numbers

2005-11-18 Thread Dave Hansen
Sorry for the delayed response. I somehow missed this earlier. On Tue, 8 Nov 2005 15:39:09 + (UTC) in comp.lang.python, [EMAIL PROTECTED] (Roy Smith) wrote: >Dave Hansen <[EMAIL PROTECTED]> wrote: >> Of course, I write _far_ more code in C than Python. But I've seen &

Re: Hot to split string literals that will across two or more lines ?

2005-11-22 Thread Dave Hansen
On Tue, 22 Nov 2005 18:38:15 + in comp.lang.python, Steve Holden <[EMAIL PROTECTED]> wrote: [...] > >Of course there's also the alternative of escaping the newlines out in >the literal. The replace result above is exactly > >"""\ >lots of text hundreds of characters long\ >more text on anothe

Re: Converting a flat list to a list of tuples

2005-11-22 Thread Dave Hansen
On Tue, 22 Nov 2005 20:12:52 GMT in comp.lang.python, [EMAIL PROTECTED] (Bengt Richter) wrote: >On Tue, 22 Nov 2005 13:26:45 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > >>Duncan Booth wrote: >> >>> That's funny, I thought your subject line said 'list of tuples'. I'll >>> answer the questio

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-23 Thread Dave Hansen
On Tue, 22 Nov 2005 23:17:31 -0700 in comp.lang.python, Steven Bethard <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: [...] >> IIRC, this was discussednd rejected in an SF bug report. It should not >> be a defined behavior for severals reasons: >[snip arguments about how confusing zip(it, i

Re: newbie question concerning formatted output

2005-11-29 Thread Dave Hansen
On Tue, 29 Nov 2005 17:40:08 GMT in comp.lang.python, Thomas Liesner <[EMAIL PROTECTED]> wrote: [...]> >So instead of: > >3905 >3009 > [...] > >i'd like to have: > >3905 3009 [...] > >This is the codesnippet i am using: > >#!/usr/bin/python > >import string >inp = open("xyplan.nobreaks","r

Re: Compiling Guppy-PE extension modules

2005-11-29 Thread Dave Hansen
On 29 Nov 2005 11:53:31 -0800 in comp.lang.python, "Sverker Nilsson" <[EMAIL PROTECTED]> wrote: [...] >One of the problems, seems to be string constants in the C source that >contain newlines. I am using GCC on Linux so, I missed this with the I'm not sure what you mean by this. Something like

Re: Python as Guido Intended

2005-11-30 Thread Dave Hansen
On 30 Nov 2005 10:57:04 GMT in comp.lang.python, Antoon Pardon <[EMAIL PROTECTED]> wrote: >On 2005-11-29, Mike Meyer <[EMAIL PROTECTED]> wrote: >> Antoon Pardon <[EMAIL PROTECTED]> writes: You see, you can make languages more powerful by *removing* things from it. >>> You cast this in wa

Re: Quene

2005-11-30 Thread Dave Hansen
On 30 Nov 2005 09:38:44 -0800 in comp.lang.python, "Tuvas" <[EMAIL PROTECTED]> wrote: >I am trying to write a function that holds a variable-length quene. The >quene has 2 bits of information. At some point, I would like to remove >bits of this quene, when they are completed. Is there a way to do

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

2005-12-02 Thread Dave Hansen
On 2 Dec 2005 10:08:21 -0800 in comp.lang.python, [EMAIL PROTECTED] wrote: >Here it is again... Python bypassed/discounted because, of all things, >scoping by indentation!?!? > >This used to surprise me. Until I hear more and more otherwise >reasonable programmers list this as their number one r

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-05 Thread Dave Hansen
On Fri, 02 Dec 2005 18:04:15 +0100 in comp.lang.python, Christophe <[EMAIL PROTECTED]> wrote: >infidel a écrit : >>>I'm using the Windows version of Python and IDLE. When I debug my .py >>>file, my modification to the .py file does not seem to take effect >>>unless I restart IDLE. Saving the file

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

2005-12-08 Thread Dave Hansen
On 8 Dec 2005 08:17:14 GMT in comp.lang.python, Antoon Pardon <[EMAIL PROTECTED]> wrote: [...] >I just think braces are the worst solution for it, as python is >concerned. Agreed. A model like Modula-2's would be much preferable, and in fact is supported (but not enforced) today (as long as you

Re: Bitching about the documentation...

2005-12-08 Thread Dave Hansen
On Wed, 07 Dec 2005 12:33:07 -0600 in comp.lang.python, Rocco Moretti <[EMAIL PROTECTED]> wrote: [...] >fred where guido had had had had had had had had had had had a better >effect on the reader I've seen this before as bill had had had but will had had had had had had or had had been correct

Unexpected Behavior Iterating over a Mutating Object

2005-09-13 Thread Dave Hansen
OK, first, I don't often have the time to read this group, so apologies if this is a FAQ, though I couldn't find anything at python.org. Second, this isn't my code. I wouldn't do this. But a colleague did, got an unexpected result, and asked me why. I think I can infer what is occurring, and I

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-14 Thread Dave Hansen
On Tue, 13 Sep 2005 21:28:21 GMT, [EMAIL PROTECTED] (Dave Hansen) wrote: >OK, first, I don't often have the time to read this group, so >apologies if this is a FAQ, though I couldn't find anything at >python.org. > Thanks to everyone who responded. All is clear now. And

Re: PHP = Perl Improved

2005-12-12 Thread Dave Hansen
On Sat, 10 Dec 2005 08:25:08 GMT in comp.lang.python, Tim Roberts <[EMAIL PROTECTED]> wrote: [...] > >The design of the PHP language is not too bad, and the standard library is >extensive. It is quite possible to write well-structured, class-based web >programs with PHP. > >However, it seems that

Re: Question about tuple lengths

2005-12-14 Thread Dave Hansen
On Wed, 14 Dec 2005 12:58:16 -0500 in comp.lang.python, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: [...] > >It's the comma that makes it a tuple. The parenthesis are only required in >cases where the expression might mean something else without them. That's almost true. Consider: >>> t2 =

Re: ?: in Python

2005-12-15 Thread Dave Hansen
On Wed, 14 Dec 2005 21:16:23 +0100 in comp.lang.python, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: >Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: >> How can do elegantly in Python: >> >> if condition: >> a=1 >> else: >> a=2 >> >> like in C: >> >> a=condition?1:2 >> > >Th

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Dave Hansen
On Thu, 15 Dec 2005 14:57:18 + in comp.lang.python, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >Would you say > > do: > suite > while condition > >or what? Basically do ... while and do ... until most naturally put the Works for me, though I wouldn't cry if the "while" was

Re: Tuples

2005-12-15 Thread Dave Hansen
On 15 Dec 2005 09:19:37 -0800 in comp.lang.python, "Tuvas" <[EMAIL PROTECTED]> wrote: >Let's say I make a program something like follows: > >x=[] >x.append([1,2,3]) >x.append([4,5,6]) >print x >print x[0] >print x[0][1] >x[0][1]=5 > >Okay, everything works here as expected except the last line. Wh

Re: How to create linked list automatically

2005-12-19 Thread Dave Hansen
On Mon, 19 Dec 2005 20:51:39 + in comp.lang.python, Simon Brunning <[EMAIL PROTECTED]> wrote: >I haven't the time (or inclination) to sort out all your problems >here, but one thing jumps out at me: > >On 12/19/05, Shahriar Shamil Uulu <[EMAIL PROTECTED]> wrote: >> class Node: >> def __ini

Re: parsing engineering symbols

2005-12-21 Thread Dave Hansen
On Wed, 21 Dec 2005 19:10:21 +0530 in comp.lang.python, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: [re: SI prefixes] > >Exactly what I wanted. > >It would be nice if the standard float function takes care of these. No, it wouldn't. Regards, -=Dave --

Re: type error on porting outfile.write

2005-12-21 Thread Dave Hansen
On Tue, 20 Dec 2005 22:11:01 -0500 in comp.lang.python, Eric McCoy <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> I ported my code from the development to >> application platform, I found a "type error" >> on a fileout statement: > >> outfile.write(object.id +",") > >What is the type of o

Re: How to check if a string "is" an int?

2005-12-21 Thread Dave Hansen
On Thu, 22 Dec 2005 01:41:34 +1100 in comp.lang.python, Steven D'Aprano <[EMAIL PROTECTED]> wrote: [...] >Well, let's find out, shall we? [...] >A small but consistent speed advantage to the try...except block. > >Having said all that, the speed difference are absolutely trivial, less >than 0.1 mi

Re: How to check if a string "is" an int?

2005-12-21 Thread Dave Hansen
On 21 Dec 2005 14:36:32 -0800 in comp.lang.python, Paul Rubin wrote: >There is a third choice which is the natural and obvious one: have the >function do what its name indicates. Return true if the arg is a >digit and false otherwise. If iterating over the whole strin

Re: Guido at Google

2005-12-21 Thread Dave Hansen
On Wed, 21 Dec 2005 16:14:16 -0600 in comp.lang.python, Rocco Moretti <[EMAIL PROTECTED]> wrote: [...] >15 meters (150 decimeter, 1500 cm, etc ...) >590 inches >49 feet >16 yards >0.0093 miles >0.008 nautical miles >3 rods >0.075 furlongs >1800 barleycorns >147.63 hands >66 spans >33 cubits >13 el

Re: problem adding list values

2005-12-22 Thread Dave Hansen
On Thu, 22 Dec 2005 19:43:15 GMT in comp.lang.python, "David M. Synck" <[EMAIL PROTECTED]> wrote: [...] >temp = float(raw_input("Please enter the first credit \n")) > >while temp != 0: >credlist.append(temp) >temp = float(raw_input("Please enter the next credit \n")) Here

Re: What's wrong with this code snippet?

2006-01-04 Thread Dave Hansen
You've received good answers to your original question. Just a side issue... On Wed, 4 Jan 2006 22:19:27 + (UTC) in comp.lang.python, Karlo Lozovina <[EMAIL PROTECTED]> wrote: [...] >def GenerateRandomColour(): >rn.seed() >colour = rn.choice(['C', 'P', 'Z']) >retu

Re: What's wrong with this code snippet?

2006-01-05 Thread Dave Hansen
On Thu, 5 Jan 2006 01:14:43 + (UTC) in comp.lang.python, Karlo Lozovina <[EMAIL PROTECTED]> wrote: >Dave Hansen <[EMAIL PROTECTED]> wrote in >news:[EMAIL PROTECTED]: > >> I'm not sure what rn is, but it looks like a standard library >> random.Random obj

Re: What is the slickest way to transpose a square list of lists (tuple of tuples)?

2006-01-09 Thread Dave Hansen
On Sun, 08 Jan 2006 14:27:55 -0500 in comp.lang.python, Gerard Brunick <[EMAIL PROTECTED]> wrote: >My way is ugly. These has to be a better way. This may not be the "slickest" way, but I needed some practice with list comprehensions (I've never really gotten used to them...) This works with lis

Re: How to create a script that list itself ?

2006-01-09 Thread Dave Hansen
On 9 Jan 2006 10:09:19 -0800 in comp.lang.python, "Patrick Allaire" <[EMAIL PROTECTED]> wrote: >How to create a script that list itself ? Stealing from the old C chestnut: s="s=%c%s%c;print s%%(34,s,34)";print s%(34,s,34) > >I would like to know, where is the script's code is stored once we >

Re: Indentation/whitespace

2006-01-12 Thread Dave Hansen
On Thu, 12 Jan 2006 11:56:05 +0800 in comp.lang.python, Jon Perez <[EMAIL PROTECTED]> wrote: [...] > >Although the below does work, I believe: Verified example: >>> def check_indent(n): if n==4: print "You like four spaces" elif n==3: print "I like three"

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-12 Thread Dave Hansen
On 11 Jan 2006 21:30:11 -0800 in comp.lang.python, [EMAIL PROTECTED] (Aahz) wrote: [..] > >Side note: I don't have a degree, and I interviewed at Google several >years ago. I'm about 97% certain that my lack of degree played little >role (if any) in my failure to get a job offer. Side note: I ha

Re: how do "real" python programmers work?

2006-01-12 Thread Dave Hansen
On 12 Jan 2006 12:20:50 -0800 in comp.lang.python, "bblais" <[EMAIL PROTECTED]> wrote: >Hello, > >Let me start by saying that I am coming from a background using Matlab >(or Octave), and C++. I am going to outline the basic nuts-and-bolts I generally write C code for embedded controllers. >of h

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-12 Thread Dave Hansen
On 12 Jan 2006 16:16:58 -0800 in comp.lang.python, [EMAIL PROTECTED] (Aahz) wrote: >In article <[EMAIL PROTECTED]>, >Dave Hansen <[EMAIL PROTECTED]> wrote: >> >>And, FWIW, I don't think I could convince my wife (or myself) to move >>to CullyFORNya for

Re: Indentation/whitespace

2006-01-17 Thread Dave Hansen
On 16 Jan 2006 20:41:24 -0800 in comp.lang.python, "thakadu" <[EMAIL PROTECTED]> wrote: >Yes, thats what you have to do. And that was my original point, you >cannot just paste and go, you have to first reformat. My heart bleeds. Regards, -=Dave -- Change

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Dave Hansen
On Wed, 18 Jan 2006 17:03:23 +0100 in comp.lang.python, Claudio Grondi <[EMAIL PROTECTED]> wrote: [...] > > >>> a = 1L > >>> b = 1L > >>> a is b >False > >Python fails to reuse the long integer object. It would be interesting >to know why, because it seems to be strange, that in case of integers

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Dave Hansen
On 18 Jan 2006 08:41:00 -0800 in comp.lang.python, [EMAIL PROTECTED] wrote: > >Fuzzyman wrote: >> I'm not familiar with the C basic datatypes - I assume it has an array >> or list like object. >> >> Would it contain a sequence of poitners to the members ? In which case >> they would only be equal

Re: OT: excellent book on information theory

2006-01-19 Thread Dave Hansen
On Thu, 19 Jan 2006 15:04:51 +0100 in comp.lang.python, Mikael Olofsson <[EMAIL PROTECTED]> wrote: >Terry Hancock wrote: >"Tim Peters" <[EMAIL PROTECTED]> wrote: >>> UK:Harry smiled vaguely back >>> US:Harry smiled back vaguely > >Terry Hancock wrote: >> I know you are pointing out the

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Dave Hansen
On Thu, 19 Jan 2006 08:06:50 +0100 in comp.lang.python, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: > [EMAIL PROTECTED] wrote] >> >Fuzzyman wrote: [...] >> >> In this case : >> >> >> >> a = ['some string

Re: New Python.org website?

2006-01-19 Thread Dave Hansen
On Thu, 19 Jan 2006 11:58:27 -0600 in comp.lang.python, Terry Hancock <[EMAIL PROTECTED]> wrote: [...] >At worst, the cross might be a reference to "The Spanish >Inquisition", which anyone who knows anything about Python >should know is topical. Perhaps, but they wouldn't expect it... Regards,

Re: Python code written in 1998, how to improve/change it?

2006-01-19 Thread Dave Hansen
On Fri, 20 Jan 2006 10:27:58 +1300 in comp.lang.python, Carl Cerecke <[EMAIL PROTECTED]> wrote: [...] > >Python has no goto. +1 [...] > >We want a goto. -1 Regards, -=Dave -- Change is inevitable, progress is not. -- http://mail.python.org/mailman/lis

Re: Restricted Access

2006-07-11 Thread Dave Hansen
On 11 Jul 2006 10:19:22 -0700 in comp.lang.python, Paul Rubin wrote: >"K.S.Sreeram" <[EMAIL PROTECTED]> writes: >> Java is not the only restricted execution environment around. >> Javascript, as implemented by most browsers, is an excellent lightweight >> restricted exec

Re: stderr, stdout, and errno 24

2006-07-12 Thread Dave Hansen
On 12 Jul 2006 18:09:42 -0700 in comp.lang.python, "Wesley Henwood" <[EMAIL PROTECTED]> wrote: >To capture output from python scripts run from a C++ app I've added the >following code at the beggening of the C++ app: > >PyRun_SimpleString("import grabber"); >PyRun_SimpleString("import sys"); >PyRu

Re: Coding style

2006-07-17 Thread Dave Hansen
On Mon, 17 Jul 2006 17:09:32 +0100 in comp.lang.python, "Simon Brunning" <[EMAIL PROTECTED]> wrote: [...] > >lst = [1,2,3,4,5] >while lst: >lst.pop() > >Or even just: > >lst = [] > del lst[:] is probably closer to what the OP wants... Regards, -=Dave

Re: Isn't there a better way?

2006-07-22 Thread Dave Hansen
On 21 Jul 2006 07:51:15 -0700 in comp.lang.python, "T" <[EMAIL PROTECTED]> wrote: > >I am using an optparse to get command line options, and then pass them >to an instance of another class: > > > ># Class that uses optparse.OptionParser >foo = Parse_Option() > ># Class that does the real work >bar

Re: a good programming text editor (not IDE)

2006-06-15 Thread Dave Hansen
On Thu, 15 Jun 2006 17:12:26 GMT in comp.lang.python, John Salerno <[EMAIL PROTECTED]> wrote: >I know there's a request for a good IDE at least once a week on the ng, >but hopefully this question is a little different. I'm looking for >suggestions for a good cross-platform text editor (which the

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 16:33:16 +0200 in comp.lang.python, Juho Schultz <[EMAIL PROTECTED]> wrote: [...] > >Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 >uses ! as comment symbol and therefore need /= instead of != for >inequality. I guess just because they wanted. However,

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 04:09:00 +0100 in comp.lang.python, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: [...] >Once you open your mind for using non-ascii symbols, I'm sure one can >find a bunch of useful applications. Variable names could be allowed to >be non-ascii, as in XML. Think class names

Re: a 32 bit number to integer

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 13:23:05 -0300 in comp.lang.python, Ricardo Quesada <[EMAIL PROTECTED]> wrote: >Hi, > > In python 2.0, this number was an integer: >0x88776655 > > but in python 2.4 it is a long (every number > 0x7fff it is a long) > >in python 2.4, is there a way to convert that numb

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 19:44:28 +0100 in comp.lang.python, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: >> C uses ! as a unary logical "not" operator, so != for "not equal" just >> seems to follow, um, logically. > >Conseq

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Wed, 25 Jan 2006 08:26:16 +1100 in comp.lang.python, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >On Tue, 24 Jan 2006 10:38:56 -0600, Dave Hansen wrote: > >> The latter, IMHO. Especially variable names. Consider i vs. ì vs. í >> vs. î vs. ï vs. ... > >Agreed

Re: Creating a more random int?

2006-01-25 Thread Dave Hansen
On Wed, 25 Jan 2006 15:21:43 - in comp.lang.python, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2006-01-25, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >> P.S. Since I was a kid, I've heard people say: So you're born >> on new years day--how unusual. > >Well, it happens to slightly less than 1/

Re: float formatting

2006-01-25 Thread Dave Hansen
On 25 Jan 2006 11:32:27 -0800 in comp.lang.python, "Brian" <[EMAIL PROTECTED]> wrote: >Hello all, > >I am a bit stuck with a float formatting issue. What I want to do is >print a float to the screen with each line showing one more decimal >place. Here is a code snip that may explain it better: >

Re: Pulling numbers from ASCII filename not working

2006-01-26 Thread Dave Hansen
On Thu, 26 Jan 2006 06:39:20 GMT in comp.lang.python, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On 25 Jan 2006 12:42:20 -0800, "IamIan" <[EMAIL PROTECTED]> declaimed the >following in comp.lang.python: [...] >> I tried print repr(filename) and it returned the actual filename: >> 'n16w099.asc'

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Dave Hansen
On Thu, 26 Jan 2006 16:26:57 GMT in comp.lang.python, "Roger L. Cauvin" <[EMAIL PROTECTED]> wrote: >"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] [...] >> Is this what you mean? >> >> ^[^a]*(a{3})(?:[^a].*)?$ > >Close, but the pattern should allow "arbitrary seq

Re: beta.python.org content

2006-01-27 Thread Dave Hansen
On Thu, 26 Jan 2006 15:28:50 -0800 in comp.lang.python, James Stroud <[EMAIL PROTECTED]> wrote: >Rocco Moretti wrote: >> (Not that I like the logo, mind you...) > >Does anyone? There has to be a better logo! I thought the previous >requirement as established by the BDFL was no snakes. These are s

Re: Using non-ascii symbols

2006-01-27 Thread Dave Hansen
Just a couple half-serious responses to your comment... On Fri, 27 Jan 2006 11:05:15 +0100 in comp.lang.python, Magnus Lycka <[EMAIL PROTECTED]> wrote: >Terry Hancock wrote: >> That's interesting. I think many people in the West tend to >> imagine han/kanji characters as archaisms that will >> di

Re: Using non-ascii symbols

2006-01-27 Thread Dave Hansen
On Fri, 27 Jan 2006 08:11:24 GMT in comp.lang.python, [EMAIL PROTECTED] (Bengt Richter) wrote: [...] >Maybe you would like the unambiguousness of >(+ 8 (* 6 2)) >or >6 2 * 8 + >? Well, I do like lisp and Forth, but would prefer Python to remain Python. Though it's hard to fit Python into

Re: beta.python.org content

2006-01-27 Thread Dave Hansen
On Fri, 27 Jan 2006 13:33:06 + in comp.lang.python, Steve Holden <[EMAIL PROTECTED]> wrote: >Shalabh Chaturvedi wrote: [...] > >> 2. "also available as the python-list mailing list" >> >> Add "or a google group (link)". It's not a "Google Group," it's a Usenet newsgroup. Google merely provi

Re: Using non-ascii symbols

2006-01-30 Thread Dave Hansen
On Fri, 27 Jan 2006 20:27:40 -0500 in comp.lang.python, Dan Sommers <[EMAIL PROTECTED]> wrote: >On Fri, 27 Jan 2006 22:29:20 GMT, >Neil Hodgson <[EMAIL PROTECTED]> wrote: > >> ... I'm so used to "/" for division that "÷" now looks strange. Indeed, I don't think I've used ÷ for division since abou

Re: "Intro to Pyparsing" Article at ONLamp

2006-01-30 Thread Dave Hansen
On Mon, 30 Jan 2006 16:39:51 -0500 in comp.lang.python, Peter Hansen <[EMAIL PROTECTED]> wrote: >Christopher Subich wrote: >> Using English, because that's the only language I'm fluent in, consider >> the sentence: >> >> "The horse raced past the barn fell." >> >> It's just one of many "garden

Re: is there a better way?

2006-02-10 Thread Dave Hansen
On Sat, 11 Feb 2006 01:37:59 +0100 in comp.lang.python, Schüle Daniel <[EMAIL PROTECTED]> wrote: >Lonnie Princehouse wrote: >> everybody is making this way more complicated than it needs to be. >> >> storage = list[:list.index(O)] > >the question is whether the old list is needed in the future or

Re: simple math question

2006-02-13 Thread Dave Hansen
On Sat, 11 Feb 2006 16:43:33 -0500 in comp.lang.python, John Salerno <[EMAIL PROTECTED]> wrote: >John Salerno wrote: >> Hi all. I'm just starting out with Python, so I'm a little slow right >> now. :) >> >> Can someone explain to me why the expression 5 / -2 evaluates to -3, >> especially consi

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Dave Hansen
On Sun, 12 Feb 2006 23:30:25 -0500 in comp.lang.python, Steve Holden <[EMAIL PROTECTED]> wrote: >John Salerno wrote: [...] > >> I know it comes from the suffix -tuple, which makes me think it's >> pronounced as 'toople', but I've seen (at m-w.com) that the first >> pronunciation option is 'tuhpl

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Dave Hansen
On Mon, 13 Feb 2006 22:30:43 +0100 in comp.lang.python, Peter Maas <[EMAIL PROTECTED]> wrote: >John Salerno schrieb: >> Terry Hancock wrote: >> >>> So what's a 1-element tuple, anyway? A "mople"? "monople"? >>> It does seem like this lopsided pythonic creature (1,) ought >>> to have a name to re

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Dave Hansen
On Mon, 13 Feb 2006 16:46:26 -0500 in comp.lang.python, Steve Holden <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: >> On Sun, 12 Feb 2006 23:30:25 -0500 in comp.lang.python, Steve Holden >> <[EMAIL PROTECTED]> wrote: [...] >> >>>"Tyoople",

Re: invert the order of a string

2006-02-13 Thread Dave Hansen
On Mon, 13 Feb 2006 18:51:11 + in comp.lang.python, rtilley <[EMAIL PROTECTED]> wrote: >s = list('some_random_string') >print s >s.reverse() >print s >s = ''.join(s) >print s > >Surely there's a better way to do this, right? How about s = "some random string" print s s = s[::-1] print s HT

Re: invert the order of a string

2006-02-13 Thread Dave Hansen
On Mon, 13 Feb 2006 19:03:32 + in comp.lang.python, rtilley <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: >> How about >> >> s = "some random string" >> print s >> s = s[::-1] >> print s > >That looks like Perl, but it works. Ma

Re: processing limitation in Python

2006-02-14 Thread Dave Hansen
On 14 Feb 2006 08:42:38 -0800 in comp.lang.python, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >If I un-comment any line in this program below the line where I >commented " all OK up to this point " This program locks up my >computer. Hmm. Ctrl-C gets me out just fine. In Idle, at least. >

Re: Merging two lists of data (Pythonic way)

2006-02-17 Thread Dave Hansen
On Thu, 16 Feb 2006 12:51:24 -0800 in comp.lang.python, "SMB" <[EMAIL PROTECTED]> wrote: > >"Jonathan Gardner" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> codes = map(lambda x: x[0], list1) >> for d in list2: >> if d['code'] in codes: >>d['VERIFIED'] = 1 >> >> Is this wha

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-20 Thread Dave Hansen
Caution: bunny trail ahead. Feel free to skip this message, as it contains no useful content whatever... On Sat, 18 Feb 2006 12:09:02 +1100 in comp.lang.python, Steven D'Aprano <[EMAIL PROTECTED]> wrote: [...] > >I've never even used Matlab. But I have a calculator. (Actually I have >about half

Re: Mutable numbers

2006-02-21 Thread Dave Hansen
On Tue, 21 Feb 2006 12:44:52 +0530 in comp.lang.python, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: ># I am new to python. > >In python all numbers are immutable. This means there is one object ( a >region in the memory ) created every time we do an numeric operation. I >hope there should have

Re: Python vs. Lisp -- please explain

2006-02-21 Thread Dave Hansen
On Tue, 21 Feb 2006 08:36:50 -0600 in comp.lang.python, "Chris Mellon" <[EMAIL PROTECTED]> wrote: [...] > >When asked to name some interpreted (or scripting) languages, they'll >name some off - perl, python, ruby, javascript, basic... > >They won't say Java. Ask them why Python is interpreted and

Re: A C-like if statement

2006-02-23 Thread Dave Hansen
On Thu, 23 Feb 2006 12:04:38 -0700 in comp.lang.python, "Bob Greschke" <[EMAIL PROTECTED]> wrote: > >"Roy Smith" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] [...] >> try: >>i = a.find("3") >>print "It's here: ", i >> except NotFound: >>print "No 3's here" > >Nuts. I

Re: How would you open this file?

2006-02-23 Thread Dave Hansen
On Thu, 23 Feb 2006 18:01:32 -0500 in comp.lang.python, Kent Johnson <[EMAIL PROTECTED]> wrote: [...] > >filename = open_file() > >By the way 'filename' is a pretty bad name, since it contains a file >object, not a string. Maybe call it f instead. ('file' is also a bad >name because it is the na

Re: The Modernization of Emacs

2007-06-20 Thread Dave Hansen
On Jun 20, 8:28 am, David Kastrup <[EMAIL PROTECTED]> wrote: > Actually, the "E" in "Emacs" stands for "extensible". Part of the > appeal of Emacs is that you can change it to accommodate you. Actually, though Emacs is the epitome of extensibility, the "E" stands for "Editor." "EMACS" is simply

Re: The Modernization of Emacs

2007-06-21 Thread Dave Hansen
On Jun 21, 9:49 am, Robert Uhl <[EMAIL PROTECTED]> wrote: > Twisted <[EMAIL PROTECTED]> writes: > > > Given that in its out-of-the-box configuration it's well-nigh unusable > > without a printed-out "cheat sheet" of some kind, of the sort that > > were supposed to have died out in the 80s, getting

Re: Suggestions for how to approach this problem?

2007-05-08 Thread Dave Hansen
On May 8, 3:00 pm, John Salerno <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch wrote: > > I think I have vague idea how the input looks like, but it would be > > helpful if you show some example input and wanted output. > > Good idea. Here's what it looks like now: > > 1. Levy, S.B. (1964)

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Dave Hansen
Apologies for jumping into the thread late. On May 27, 3:25 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Is C no longer a "major" language? The long-standing convention there > > is for lower_case_with_underscores. > > Which dates back to the days of ASR-33'

Re: regexp problem in Python

2007-08-03 Thread Dave Hansen
On Aug 3, 4:41 pm, Ehsan <[EMAIL PROTECTED]> wrote: > I want to find "http://www.2shared.com/download/1716611/e2000f22/ [...] > I use this pattern : > "http.*?\.(wmv|3gp).*"" > > but it returns only 'wmv' and '3gp' instead of "http://www.2shared.com/ > download/1716611/e2000f22/Jadeed_Mlak14.wmv? >

Re: Newbee Question

2007-08-21 Thread Dave Hansen
On Aug 21, 2:57 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: [...] > > pay = min(num, 22) * 0.4 + max(num-22, 0) * 1.4 pay = num*0.4 + (num>22)*(num-22) ;-) -=Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Car-ac-systems

2007-09-11 Thread Dave Hansen
On Sep 11, 12:42 pm, Zentrader <[EMAIL PROTECTED]> wrote: > > What is it about "please do not top-post" that you have difficulty > understanding? Or do "MVP"s feel that their time is so much more > valuable than anyone else's that they are free to ignore the norms? > > Who made this the norm? htt

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Dave Hansen
On Sep 12, 5:21 am, Charles Fox <[EMAIL PROTECTED]> wrote: > I've just started playing around with Python, as a possible > replacement for a mix of C++, Matlab and Lisp. The language looks > lovely and clean with one huge exception: I do a lot of numerical > modeling, so I deal with objects (like

Re: Mastering Python

2007-03-16 Thread Dave Hansen
On Mar 16, 8:39 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote: [...] > Stop thinking about *how* to start and *just start*. Python is pretty Indeed. Of all the fortune cookies I've eaten over the years, I've saved (and taped to my monitor) only one fortune. It reads: Begin...the rest is easy.

Re: Finding overlapping times...

2007-12-13 Thread Dave Hansen
On Dec 13, 5:45 pm, Breal <[EMAIL PROTECTED]> wrote: > I have a list that looks like the following > [(10, 100010), (15, 17), (19, 100015)] > > I would like to be able to determine which of these overlap each > other. So, in this case, tuple 1 overlaps with tuples 2 and 3. Tuple >

  1   2   >