Re: What's going on here?

2016-06-01 Thread Lawrence D’Oliveiro
On Monday, May 23, 2016 at 9:47:15 AM UTC+12, DFS wrote: > def splitrange(b,e,g): > sr=[] > for i in range(b,e,g): > bg=i;eg=min(e,bg+g-1) > sr.append((bg,eg)) > return sr To be more in keeping with the Python ethos, I would take out the “-1”. -- http

Re: What's Going on between (Verify) Python and win7?

2010-02-24 Thread Tim Roberts
"W. eWatson" wrote: >Maybe someone could verify my result? > >open file >read file line >print line >close file > >data 1234 > >Execute it in a folder > >Create another folder and copy the program to it. >put in a new data file as > >data 4567 > >Execute the copied program >Does it give >data1234

Re: What's Going on between Python and win7?

2010-02-23 Thread Steven D'Aprano
On Tue, 23 Feb 2010 09:34:00 -0500, Jerry Hill wrote: > On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson > wrote: >> So what's the bottom line? This link notion is completely at odds with >> XP, and produces what I would call something of a mess to the unwary >> Python/W7 user. Is there a simple solut

Re: What's Going on between Python and win7?

2010-02-23 Thread Lie Ryan
On 02/23/10 05:30, W. eWatson wrote: > On 2/22/2010 8:29 AM, Grant Edwards wrote: >> On 2010-02-22, W. eWatson wrote: >> >>> Last night I copied a program from folder A to folder B. >> >> [tail of various windows breakages elided] >> >>> Comments? >> >> Switch to Linux? >> >> Or at least install C

Re: What's Going on between Python and win7?

2010-02-23 Thread Benjamin Kaplan
On Tue, Feb 23, 2010 at 3:35 PM, Michel Claveau - MVP wrote: > Hi! > >> Symbolic links are available in NTFS starting with Windows Vista. > > No. > Hardlink come with NTFS, and already exists in W2K (and NT with specifics > utilities). > > @-salutations > -- > Michel Claveau > And there's a diff

Re: What's Going on between Python and win7?

2010-02-23 Thread buggsy2
"W. eWatson" writes: > I noted that this search box has > some sort of filter associated with it. Possibly, in my early stages > of learning to navigate in Win7, I accidentally set the filter. > > Comments? FYI, the only truly reliable and powerful file search utility I've found for Windows is A

Re: What's Going on between Python and win7?

2010-02-23 Thread Michel Claveau - MVP
Hi! > Symbolic links are available in NTFS starting with Windows Vista. No. Hardlink come with NTFS, and already exists in W2K (and NT with specifics utilities). @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between Python and win7?

2010-02-23 Thread Gib Bogle
chris grebeldinger wrote: Have you tried opening file explorer in administrative mode before performing the copy? I think if there isn't sufficient permissions, it does something weird like that. No -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between Python and win7?

2010-02-23 Thread chris grebeldinger
Have you tried opening file explorer in administrative mode before performing the copy? I think if there isn't sufficient permissions, it does something weird like that. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between Python and win7?

2010-02-23 Thread Jerry Hill
On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson wrote: > So what's the bottom line? This link notion is completely at odds with XP, > and produces what I would call something of a mess to the unwary Python/W7 > user. Is there a simple solution? I know people went off on a tangent talking about symbol

Re: What's Going on between Python and win7?

2010-02-22 Thread Alf P. Steinbach
* W. eWatson: On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in

Re: What's Going on between (Verify) Python and win7?

2010-02-22 Thread W. eWatson
Maybe someone could verify my result? open file read file line print line close file data 1234 Execute it in a folder Create another folder and copy the program to it. put in a new data file as data 4567 Execute the copied program Does it give data1234? -- http://mail.python.org/mailman/lis

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python sta

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote: * W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python sta

Re: What's Going on between Python and win7?

2010-02-22 Thread Alf P. Steinbach
* W. eWatson: So what's the bottom line? This link notion is completely at odds with XP, Well, Windows NT has always had *hardlinks*. I found it a bit baffling that that functionality is documented as not implemented for Windows in the Python standard library. But OK, it was non-trivial to

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 6:39 PM, David Robinow wrote: On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson wrote: How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an ancestor. Ask in an appropriate forum. I'm not sure where that is but you might try http://

Re: What's Going on between Python and win7?

2010-02-22 Thread David Robinow
On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson wrote: > How do I get out of this pickle? I just want to duplicate the  program in > another folder, and not link to an ancestor. Ask in an appropriate forum. I'm not sure where that is but you might try http://www.sevenforums.com/ -- http://mail.python

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
So what's the bottom line? This link notion is completely at odds with XP, and produces what I would call something of a mess to the unwary Python/W7 user. Is there a simple solution? How do I get out of this pickle? I just want to duplicate the program in another folder, and not link to an a

Re: What's Going on between Python and win7?

2010-02-22 Thread Lawrence D'Oliveiro
In message <873a0tszco@castleamber.com>, John Bokma wrote: > According to http://msdn.microsoft.com/en-us/library/aa365006(VS.85).aspx > > There are three types of file links supported in the NTFS file > system: hard links, junctions, and symbolic links. This topic is an > overvie

Re: What's Going on between Python and win7?

2010-02-22 Thread Lawrence D'Oliveiro
In message , MRAB wrote: > Not Python-related. Seems to be pretty common with Windows-related complaints in this group. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's Going on between Python and win7?

2010-02-22 Thread Grant Edwards
On 2010-02-22, John Bokma wrote: > Grant Edwards writes: Windows 7 has symbolic links? >>> >>>Symbolic links are designed to aid in migration and application >>>compatibility with UNIX operating systems. Microsoft has implemented >>>its symbolic links to function just like UNIX

Re: What's Going on between Python and win7?

2010-02-22 Thread Gib Bogle
John Bokma wrote: Gib Bogle writes: MRAB wrote: W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B.

Re: What's Going on between Python and win7?

2010-02-22 Thread John Bokma
Grant Edwards writes: > On 2010-02-22, John Bokma wrote: >> Gib Bogle writes: >> >>> MRAB wrote: W. eWatson wrote: > Last night I copied a program from folder A to folder B. It > inspects the contents of files in a folder. When I ran it in B, it > gave the results for A! Out of

Re: What's Going on between Python and win7?

2010-02-22 Thread Grant Edwards
On 2010-02-22, John Bokma wrote: > Gib Bogle writes: > >> MRAB wrote: >>> W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name i

Re: What's Going on between Python and win7?

2010-02-22 Thread John Bokma
Gib Bogle writes: > MRAB wrote: >> W. eWatson wrote: >>> Last night I copied a program from folder A to folder B. It >>> inspects the contents of files in a folder. When I ran it in B, it >>> gave the results for A! Out of frustration I changed the name in A, >>> and fired up the program in B. Wi

Re: What's Going on between Python and win7?

2010-02-22 Thread Gib Bogle
MRAB wrote: W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B. Win7 went into search mode for the fil

Re: What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
On 2/22/2010 8:29 AM, Grant Edwards wrote: On 2010-02-22, W. eWatson wrote: Last night I copied a program from folder A to folder B. [tail of various windows breakages elided] Comments? Switch to Linux? Or at least install Cygwin? Yes, definitely not related, but maybe some W7 user has

Re: What's Going on between Python and win7?

2010-02-22 Thread Shashwat Anand
Programming is most fruiful in *nix environment. On Mon, Feb 22, 2010 at 9:59 PM, Grant Edwards wrote: > On 2010-02-22, W. eWatson wrote: > > > Last night I copied a program from folder A to folder B. > > [tail of various windows breakages elided] > > > Comments? > > Switch to Linux? > > Or at l

Re: What's Going on between Python and win7?

2010-02-22 Thread Grant Edwards
On 2010-02-22, W. eWatson wrote: > Last night I copied a program from folder A to folder B. [tail of various windows breakages elided] > Comments? Switch to Linux? Or at least install Cygwin? -- Grant Edwards grante Yow! Maybe I should have

Re: What's Going on between Python and win7?

2010-02-22 Thread MRAB
W. eWatson wrote: Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B. Win7 went into search mode for the file. I looked a

Re: What's Going on between Python and win7?

2010-02-22 Thread Krister Svanlund
On Mon, Feb 22, 2010 at 4:22 PM, W. eWatson wrote: > Last night I copied a program from folder A to folder B. It inspects the > contents of files in a folder. When I ran it in B, it gave the results for > A! Out of frustration I changed the name in A, and fired up the program in > B. Win7 went int

What's Going on between Python and win7?

2010-02-22 Thread W. eWatson
Last night I copied a program from folder A to folder B. It inspects the contents of files in a folder. When I ran it in B, it gave the results for A! Out of frustration I changed the name in A, and fired up the program in B. Win7 went into search mode for the file. I looked at properties for t

Re: What's Going On?

2008-03-13 Thread castironpi
gt; > 1 > >>>> f() > > 2 > >>>> f() # 'list' is a name bound to a list (mutable) so this makes sense > > 3 > >>>> f([5]) > > 6 > >>>>f() # What's Going On? > > 4 > > That the same default a

Re: What's Going On?

2008-03-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > (Accompanied by Marvin Gaye) > >>>> def f(list=[0]): > ...list[0]+=1 > ...return list[0] > ... >>>> f() > 1 >>>> f() > 2 >>>> f() # 'list' is a name bound to a list (mutable) so thi

Re: What's Going On?

2008-03-13 Thread Peter Otten
[EMAIL PROTECTED] wrote: > (Accompanied by Marvin Gaye) > >>>> def f(list=[0]): > ...list[0]+=1 > ...return list[0] > ... >>>> f() > 1 >>>> f() > 2 >>>> f() # 'list' is a name bound to a list (mutabl

What's Going On?

2008-03-13 Thread MartinRinehart
(Accompanied by Marvin Gaye) >>> def f(list=[0]): ...list[0]+=1 ...return list[0] ... >>> f() 1 >>> f() 2 >>> f() # 'list' is a name bound to a list (mutable) so this makes sense 3 >>> f([5]) 6 >>>f() # What's Going O

Re: function with list argument defaulting to [] - what's going on here???

2007-04-15 Thread Tim Leslie
On 14 Apr 2007 20:20:42 -0700, Paddy <[EMAIL PROTECTED]> wrote: > On Apr 15, 3:58 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: > > On Sat, 14 Apr 2007 17:33:11 -0800, Troy Melhase wrote: > > > On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: > > >> While trying to write a recursive function involvin

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 15 Apr 2007 05:29:01 +0200, BJörn Lindqvist wrote: > > >> This comes up so often that I wonder whether Python should issue a warning > >> when it sees [] or {} as a default argument. > >> > >> > >> What do people think? A misuse or good use of

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Steven D'Aprano
On Sun, 15 Apr 2007 05:29:01 +0200, BJörn Lindqvist wrote: >> This comes up so often that I wonder whether Python should issue a warning >> when it sees [] or {} as a default argument. >> >> >> What do people think? A misuse or good use of warnings? > > I think Python should reevaluate the defaul

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread BJörn Lindqvist
> This comes up so often that I wonder whether Python should issue a warning > when it sees [] or {} as a default argument. > > > What do people think? A misuse or good use of warnings? I think Python should reevaluate the default values. -- mvh Björn -- http://mail.python.org/mailman/listinfo/

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Paddy
On Apr 15, 3:58 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 14 Apr 2007 17:33:11 -0800, Troy Melhase wrote: > > On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: > >> While trying to write a recursive function involving lists, I came > >> across some (to me) odd behavior which I don't quite

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Alex Martelli
Mike <[EMAIL PROTECTED]> wrote: ... > Why is "r" not being reset to the empty list on subsequent calls? It > seems like it should be reinitialized when not explicitly provided. Alex -- http://mail.python

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Steven D'Aprano
On Sat, 14 Apr 2007 17:33:11 -0800, Troy Melhase wrote: > On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: >> While trying to write a recursive function involving lists, I came >> across some (to me) odd behavior which I don't quite understand. Here's >> a trivial function showing the problem. > > fro

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Mike
Thanks, Troy. I never cease to be amazed at what can be discovered by reading the manual! Mike Troy Melhase wrote: > On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: >> While trying to write a recursive function involving lists, I came >> across some (to me) odd behavior which I don't quite understa

Re: function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Troy Melhase
On 4/14/07, Mike <[EMAIL PROTECTED]> wrote: > While trying to write a recursive function involving lists, I came > across some (to me) odd behavior which I don't quite understand. Here's > a trivial function showing the problem. from http://docs.python.org/ref/function.html : Default parameter va

function with list argument defaulting to [] - what's going on here???

2007-04-14 Thread Mike
While trying to write a recursive function involving lists, I came across some (to me) odd behavior which I don't quite understand. Here's a trivial function showing the problem. >>> def f(l, r = []): for itm in l: r.append(itm) print r >>> a = [1,2,3]

Re: What's going on here?

2006-11-23 Thread Carl Banks
Dale Strickland-Clark wrote: > Thanks for the answers. I am informed but I don't feel enlightened. > > It does strike me as odd that an apparently empty subclass should add extra > function to the base class. > > Not at all obvious. Remember that a class definition is syntax sugar for a direct cal

Re: What's going on here?

2006-11-23 Thread robert
Dale Strickland-Clark wrote: > Thanks for the answers. I am informed but I don't feel enlightened. > > It does strike me as odd that an apparently empty subclass should add extra > function to the base class. > > Not at all obvious. Yes. As said, there is missing a __builtin__.Object object i

Re: What's going on here?

2006-11-23 Thread Dale Strickland-Clark
Thanks for the answers. I am informed but I don't feel enlightened. It does strike me as odd that an apparently empty subclass should add extra function to the base class. Not at all obvious. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Riverhall Syst

Re: X class missing in Python :-) - Re: What's going on here?

2006-11-23 Thread robert
John Machin wrote: > robert wrote: >> Dale Strickland-Clark wrote: >>> Python 2.4.2 (#1, Oct 13 2006, 17:11:24) >>> [GCC 4.1.0 (SUSE Linux)] on linux2 >>> Type "help", "copyright", "credits" or "license" for more information. >> a = object() >> a >>> >> a.spam = 1 >>> Traceback (most r

Re: X class missing in Python :-) - Re: What's going on here?

2006-11-22 Thread John Machin
robert wrote: > Dale Strickland-Clark wrote: > > Python 2.4.2 (#1, Oct 13 2006, 17:11:24) > > [GCC 4.1.0 (SUSE Linux)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > a = object() > a > > > a.spam = 1 > > Traceback (most recent call last): > >

X class missing in Python :-) - Re: What's going on here?

2006-11-22 Thread robert
Dale Strickland-Clark wrote: > Python 2.4.2 (#1, Oct 13 2006, 17:11:24) > [GCC 4.1.0 (SUSE Linux)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. a = object() a > a.spam = 1 > Traceback (most recent call last): > File "", line 1, in ? > Attribut

Re: What's going on here?

2006-11-22 Thread Gerald Klix
Perhaps this piece of code might explain the behaviour: >>> class C( object ): ... __slots__ = () ... >>> o = C() >>> o.a = 1 Traceback (most recent call last): File "", line 1, in ? AttributeError: 'C' object has no attribute 'a' object behaves like having an implict __slots__ attrib

Re: What's going on here?

2006-11-22 Thread Fredrik Lundh
Dale Strickland-Clark wrote: > Why can't I assign to attributes of an instance of object? it doesn't have any attribute storage. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's going on here?

2006-11-22 Thread Richie Hindle
> What is subclassing adding to the class here? A __dict__: >>> o = object() >>> dir(o) ['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__'] >>> class C(object): pass ... >>> c = C() >>

Re: What's going on here?

2006-11-22 Thread Scott David Daniels
Dale Strickland-Clark wrote: > Python 2.4.2 (#1, Oct 13 2006, 17:11:24) a = object() a.spam = 1 > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'object' object has no attribute 'spam' class B(object): pass a = B() a.spam = 1 > > What i

What's going on here?

2006-11-22 Thread Dale Strickland-Clark
Python 2.4.2 (#1, Oct 13 2006, 17:11:24) [GCC 4.1.0 (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a = object() >>> a >>> a.spam = 1 Traceback (most recent call last): File "", line 1, in ? AttributeError: 'object' object has no attribute 'spam

Re: what's going on here?

2006-04-04 Thread Roel Schroeven
John Salerno schreef: > But thank god I'm passed this problem, although I'm sure it only gets > worse now! Yes, I'm afraid it does. I got stuck at puzzle 27 and gave up temporarily. I'm going to try again though when I feel I need a challenge :) -- If I have been able to see further, it was on

Re: what's going on here?

2006-04-04 Thread John Salerno
John Salerno wrote: > Ant wrote: >> You are along the right lines. Try printing out the content of each URL >> - one of the pages will match your expression, but has additional >> instructions... I think you are reaching the end of their false trail >> when you get None returned from the url. > >

Re: what's going on here?

2006-04-04 Thread John Salerno
Ant wrote: > You are along the right lines. Try printing out the content of each URL > - one of the pages will match your expression, but has additional > instructions... I think you are reaching the end of their false trail > when you get None returned from the url. But the weird thing is that wh

Re: what's going on here?

2006-04-04 Thread Ant
You are along the right lines. Try printing out the content of each URL - one of the pages will match your expression, but has additional instructions... I think you are reaching the end of their false trail when you get None returned from the url. The set of pages themselves are the linked list -

Re: what's going on here?

2006-04-03 Thread John Salerno
John Salerno wrote: > Ok, long story Ok, I guess I should have used a better title for the thread. I hope someone still sees this post! :) -- http://mail.python.org/mailman/listinfo/python-list

what's going on here?

2006-04-03 Thread John Salerno
Ok, long story: I'm trying to solve level 4 of the Python Challenge. I hate to post here, but the hint forum over there is dead. Here's the link: http://www.pythonchallenge.com/pc/def/linkedlist.php Apparently you need to use a linked list to solve it, so I read up on them but I still don't und

Re: what's going on here?

2006-03-16 Thread John Salerno
Felipe Almeida Lessa wrote: > # Suppose line is "200412 34.235.233.2" > # for our comments > > # Creates a list, like ["2004", "12", "34.2", "35.2", "33.2"] > splitted = line.split() Thanks guys! I think what I forgot was that split() returns a list, so that's when the 'rows'

Re: what's going on here?

2006-03-16 Thread Felipe Almeida Lessa
Em Qui, 2006-03-16 às 16:31 +, John Salerno escreveu: > So finally here's my question: If you are using data.append(), doesn't > that just put all the numbers into one long list? How are the tuples > still being created in this case so that the list comprehensions still > work? It seems like

Re: what's going on here?

2006-03-16 Thread Schüle Daniel
[...] > So finally here's my question: If you are using data.append(), doesn't > that just put all the numbers into one long list? no, append appends extend does what you think How are the tuples > still being created in this case so that the list comprehensions still > work? It seems like th

what's going on here?

2006-03-16 Thread John Salerno
This might be confusing to explain, because it's a question about an example in Beginning Python and I'll try to provide all the info I can. First off, I'm reading a chapter on using the ReportLab modules to create a line graph from a set of data. The first implementation of the program uses a

Re: mod_python: what's going on here?

2005-09-05 Thread Olivier
Robert J. Hansen a écrit : > Does anyone have any experience with mod_python on OS X/Apache > environments? Can anyone shed some light on 500s that don't leave > traces in the error logs, or what precise incantation I need to make > mod_python start serving up scripts? Here is a setup that

Re: mod_python: what's going on here?

2005-09-04 Thread Steve Holden
Robert J. Hansen wrote: > I'm not entirely certain comp.lang.python is the proper newsgroup for > mod_python questions, but "comp.lang.python.web" doesn't seem to exist, > so... my apologies in advance if this is considered off-topic. > > I'm attempting to get mod_python 3.1.4/python 2.4.1 working

mod_python: what's going on here?

2005-09-04 Thread Robert J. Hansen
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered off-topic. I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache 2.0.54 running under OS