Re: What does "::" mean?

2005-07-21 Thread Jim Sizelove
Robert Kern wrote: > Michael Hoffman wrote: > >> Robert Kern wrote: > > >>> Well, that part's easy at least: >>> >>> live[::-1] >>> >>> :-) And so the circle is complete ... >> >> >> What about reversed(live)? Or if you want a list instead of an >> iterator, list(reversed(live))? > > > That

Re: Difference between " and '

2005-07-21 Thread Michael Hoffman
John Machin wrote: > [EMAIL PROTECTED] wrote: > >> Can someone tell me the difference between single quote and double >> quote? > > >>> ord("'") - ord('"') > 5 Very zen. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > Michael Hoffman wrote: > >>Having path descend from str/unicode is extremely useful since I can >>then pass a path object to any function someone else wrote without >>having to worry about whether they were checking for basestring. I think >>there is a widely used p

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > John Roth wrote: > >>Why did Guido want a PEP? > > He said, > > """ > Whoa! Do we really need a completely different mechanism for doing the > same stuff we can already do? The path module seems mostly useful for > folks coming from Java who are used to the Java Path

Difference between " and '

2005-07-21 Thread [EMAIL PROTECTED]
Hi, Can someone tell me the difference between single quote and double quote? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Need to interrupt to check for mouse movement

2005-07-21 Thread Peter Hansen
Jp Calderone wrote: > On Thu, 21 Jul 2005 02:33:05 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote: >> (And since there is even a wxPython main loop >> integrated with and provided in Twisted, surely you aren't arguing that >> what wx does is somehow unusual or bad.) > > Blocking inside the mainloop

Re: Web-Forms

2005-07-21 Thread Mike Meyer
Mathias Waack <[EMAIL PROTECTED]> writes: > Hi, > > I need to access some information from a web site which are only accessible > through a form. Thus for each bucket of data you have to fill out the form, > submit it and wait for an answer. Very easy - if you don't have to check > some hundred t

Re: python certification

2005-07-21 Thread [EMAIL PROTECTED]
yeah i figured that since i can't get a certificate i'll make a program and put it on source forge. thanks for all your input. btw. your right i have absolutly no idea what i was getting into but then again thats whats these groups are for...to ask right??? -- http://mail.python.org/mailman/lis

looking for a book on python

2005-07-21 Thread David Fickbohm
People, could someone please recommend a book on python. Ideally a windows oriented one ? Thanks DaveDave FickbohmUse Technology to the Fullest1250 45th st suite 200Emeryville, CA, 94608510 594 4151 voice__Do You Yahoo!?Tired of spam? Yahoo! Mail has

Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-21 Thread Thomas Bartkus
On Wed, 20 Jul 2005 18:37:48 +1000, David Trudgett wrote: > My advice would be to steer clear of Kylix and choose one of the other > environments suggested to you. If you really like Pascal, fpc may be a > possibility as someone mentioned. ... Well - I really like Python! But - climbing back o

Re: Difference between " and '

2005-07-21 Thread jepler
The only difference is when you want to include " or ' inside the string. If you want to include the "like" quote, then escape it ("\"", '\''). If you include the "unlike" quote, no escape is needed ("'" or '"'). I think that people new to programming will use '' if it is unshifted on their keyb

Re: Generating images with text in them

2005-07-21 Thread Terry Hancock
On Thursday 21 July 2005 05:23 am, Daren Russell wrote: > I've just been playing around with this. You can use truetype fonts with: > > font = ImageFont.truetype("/path/to/font.ttf", 12) > > from version 1.1.4 > > http://www.pythonware.com/library/pil/handbook/imagefont.htm for more Wow, I did

Re: Difference between " and '

2005-07-21 Thread Robert Kern
[EMAIL PROTECTED] wrote: > The only difference is when you want to include " or ' inside the string. If > you want to include the "like" quote, then escape it ("\"", '\''). If you > include the "unlike" quote, no escape is needed ("'" or '"'). > > I think that people new to programming will use

Re: Copying attributes

2005-07-21 Thread Terry Hancock
On Thursday 21 July 2005 03:47 am, red wrote: > Terry Hancock wrote: > > I'm not sure either, yet, but can you indicate which line in your > > listing is 102 in the source file? That might be helpful. > > 101: ## f1.normal = copy.deepcopy(f.normal) > 102: f1.normal = NMesh.Vert(f.normal[0]

Apology [was: is this pythonic]

2005-07-21 Thread Steven D'Aprano
It has been suggested to me off-list that my response(s) to Bill Mill in the "is this pythonic" thread were rude and hostile. If that is what people saw in my posts, then I apologise, because that wasn't my intention. In fact, my comments weren't especially even aimed at Bill -- they were int

Re: Returning histogram-like data for items in a list

2005-07-21 Thread Bruno Desthuilliers
Ric Deez a écrit : > Hi there, > > I have a list: > L1 = [1,1,1,2,2,3] > > How can I easily turn this into a list of tuples where the first element > is the list element and the second is the number of times it occurs in > the list (I think that this is referred to as a histogram): > > i.e.: >

Re: Difference between " and '

2005-07-21 Thread Steven D'Aprano
Michael Hoffman wrote: > John Machin wrote: > >> [EMAIL PROTECTED] wrote: >> >>> Can someone tell me the difference between single quote and double >>> quote? >> >> >>> ord("'") - ord('"') >> 5 > > Very zen. But unfortunately incorrect, since the original poster didn't ask for the difference

Re: Difference between " and '

2005-07-21 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > Hi, > > Can someone tell me the difference between single quote and double > quote? There is none. Except that in a double quoted string, single quotes don't have to be escaped and vice versa, sometimes one of the two forms saves you some backslashes: "That's my house"

Re: Returning histogram-like data for items in a list

2005-07-21 Thread George Sakkis
"jeethu_rao" <[EMAIL PROTECTED]> wrote: > Adding to George's reply, if you want slightly more performance, you > can avoid the exception with something like > > def hist(seq): > h = {} > for i in seq: > h[i] = h.get(i,0)+1 > return h.items() > > Jeethu Rao The performance penalty of t

Re: Copying attributes

2005-07-21 Thread Terry Hancock
On Thursday 21 July 2005 08:17 pm, Terry Hancock wrote: > But is "faces" a list, > dictionary, or tuple (or something more obscure)? Lest it be unclear why this matters: >>> da = {'a':1, 'b':2, 'c':3} >>> for d in da: ... print d ... a c b >>> la = [1,2,3] >>> for d in la: ... print d ..

Re: Difference between " and '

2005-07-21 Thread Robert Kern
Steven D'Aprano wrote: > Michael Hoffman wrote: > >>John Machin wrote: >> >>>[EMAIL PROTECTED] wrote: >>> Can someone tell me the difference between single quote and double quote? >>> >>> >>> ord("'") - ord('"') >>>5 >> >>Very zen. > > But unfortunately incorrect, since the original poste

Setting environment variables for tcsh session

2005-07-21 Thread David Durkee
Hi, I'm trying to write a script I can run from tcsh in Terminal (on Mac OS X) that will set environment variables that can be accessed by subsequent commands I execute in that session. Not having any luck so far. Here's what I've tried: #!/usr/bin/python import sys import commands

Re: Generating images with text in them

2005-07-21 Thread Terry Hancock
On Thursday 21 July 2005 11:29 am, phil hunt wrote: > On Thu, 21 Jul 2005 02:44:03 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: > >On Wednesday 20 July 2005 11:59 pm, phil hunt wrote: > >> I am trying to generate some images (gifs or pngs) with text in > >> them. I can use the Python Imaging Li

Re: Difference between " and '

2005-07-21 Thread Benji York
Steven D'Aprano wrote: > Michael Hoffman wrote: >>John Machin wrote: >>>[EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? >>> >>> ord("'") - ord('"') >>>5 >>Very zen. > But unfortunately incorrect, since the original poster > didn't ask f

Re: Setting environment variables for tcsh session

2005-07-21 Thread Dan Sommers
On Thu, 21 Jul 2005 21:39:01 -0500, David Durkee <[EMAIL PROTECTED]> wrote: > I'm trying to write a script I can run from tcsh in Terminal (on Mac > OS X) that will set environment variables that can be accessed by > subsequent commands I execute in that session. Not having any luck so > far. Her

Re: Stupid question: Making scripts python-scripts

2005-07-21 Thread Benjamin Niemann
Jan Danielsson wrote: > Hello all, > >How do I make a python script actually a _python_ in unix:ish > environments? > > I know about adding: > #!/bin/sh > >..as the first row in a shell script, but when I installed python on > a NetBSD system, I didn't get a "python" executable; only a

Detecting computers on network

2005-07-21 Thread Sandeep Arya
Hello dear I had sent my earlier queries regarding same topic. However just to be more specific this time.. I just wann try to detect that if there are some ip address in a list of some ip address alive or not. How can i do this? Shall i try to connect them and check that my connection is wor

Re: Detecting computers on network

2005-07-21 Thread linuxfreak
How about sending an ICMP echo packet to your broadcast address and checking which hosts send a reply -- http://mail.python.org/mailman/listinfo/python-list

<    1   2