Experimentation and dealing with transient broken code (was: Python end of file marker similar to perl's __END__)

2007-08-02 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > It's not just "bad syntax" that makes the triple-quote or comment > trick useful. Okay. That was the original reason given for refusing suggestions like "return early from the function" etc. I answered in that context. > Because you're experimenting,

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread kyosohma
On Aug 2, 8:08 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-02, Magnus Lycka <[EMAIL PROTECTED]> wrote: > > > > > Neil Cerutti wrote: > >> On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . > >>> I want to re-emphasize the "triple-quote it" tip mentioned > >>> earlier in this

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Neil Cerutti
On 2007-08-02, Magnus Lycka <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . >>> I want to re-emphasize the "triple-quote it" tip mentioned >>> earlier in this thread. I think the original questioner >>> will find this quite satisfy

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Steven D'Aprano
On Thu, 02 Aug 2007 10:00:04 +1000, Ben Finney wrote: > beginner <[EMAIL PROTECTED]> writes: > >> Thanks everyone for responding. It doesn't look like python has >> it. I would definitely miss it. As Steve said, the nice thing about >> __END__ is that things below __END__ do not have to have legi

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Magnus Lycka
Neil Cerutti wrote: > On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . >> I want to re-emphasize the "triple-quote it" tip mentioned >> earlier in this thread. I think the original questioner >> will find this quite satisfying, if I understand his situ- >> ation at all. >> >> *I* ce

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Ben Finney
beginner <[EMAIL PROTECTED]> writes: > Thanks everyone for responding. It doesn't look like python has > it. I would definitely miss it. As Steve said, the nice thing about > __END__ is that things below __END__ do not have to have legit > syntax. I think the unaddressed question is: Why is there

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Neil Cerutti <[EMAIL PROTECTED]> wrote: >>On 2007-08-01, beginner <[EMAIL PROTECTED]> wrote: >>> Thanks everyone for responding. It doesn't look like python has >>> it. I would definitely miss it. As Steve

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Neil Cerutti <[EMAIL PROTECTED]> wrote: >On 2007-08-01, beginner <[EMAIL PROTECTED]> wrote: >> Thanks everyone for responding. It doesn't look like python has >> it. I would definitely miss it. As Steve said, the nice thing >> about __END__ is that things below __EN

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Chris Mellon
On 8/1/07, beginner <[EMAIL PROTECTED]> wrote: > On Jul 31, 10:53 pm, beginner <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > This is just a very simple question about a python trick. > > > > In perl, I can write __END__ in a file and the perl interpreter will > > ignore everything below that line.

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Diez B. Roggisch
beginner wrote: > On Jul 31, 10:53 pm, beginner <[EMAIL PROTECTED]> wrote: >> Hi All, >> >> This is just a very simple question about a python trick. >> >> In perl, I can write __END__ in a file and the perl interpreter will >> ignore everything below that line. This is very handy when testing my

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Neil Cerutti
On 2007-08-01, beginner <[EMAIL PROTECTED]> wrote: > Thanks everyone for responding. It doesn't look like python has > it. I would definitely miss it. As Steve said, the nice thing > about __END__ is that things below __END__ do not have to have > legit syntax. That let me focus on the lines of cod

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread beginner
On Jul 31, 10:53 pm, beginner <[EMAIL PROTECTED]> wrote: > Hi All, > > This is just a very simple question about a python trick. > > In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python ha

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Magnus Lycka
beginner wrote: > Hi All, > > This is just a very simple question about a python trick. > > In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python have something similar? raise SystemExit

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Stargaming
On Wed, 01 Aug 2007 06:56:36 -0400, Steve Holden wrote: > Stargaming wrote: >> On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: >> >>> On Aug 1, 5:53 am, beginner <[EMAIL PROTECTED]> wrote: Hi All, This is just a very simple question about a python trick. In p

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Steve Holden
Stargaming wrote: > On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: > >> On Aug 1, 5:53 am, beginner <[EMAIL PROTECTED]> wrote: >>> Hi All, >>> >>> This is just a very simple question about a python trick. >>> >>> In perl, I can write __END__ in a file and the perl interpreter will >>

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Ben Finney
beginner <[EMAIL PROTECTED]> writes: > In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. IIRC, this Perl feature is specifically intended to work with its feature of reading data from the same file, as all the lines following that marker. >

Re: Python end of file marker similar to perl's __END__

2007-07-31 Thread Stargaming
On Wed, 01 Aug 2007 05:44:21 +, Michele Simionato wrote: > On Aug 1, 5:53 am, beginner <[EMAIL PROTECTED]> wrote: >> Hi All, >> >> This is just a very simple question about a python trick. >> >> In perl, I can write __END__ in a file and the perl interpreter will >> ignore everything below tha

Re: Python end of file marker similar to perl's __END__

2007-07-31 Thread Michele Simionato
On Aug 1, 5:53 am, beginner <[EMAIL PROTECTED]> wrote: > Hi All, > > This is just a very simple question about a python trick. > > In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python have

Re: Python end of file marker similar to perl's __END__

2007-07-31 Thread Martin v. Löwis
> In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python have something similar? Sorry, no, it doesn't. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Python end of file marker similar to perl's __END__

2007-07-31 Thread beginner
Hi All, This is just a very simple question about a python trick. In perl, I can write __END__ in a file and the perl interpreter will ignore everything below that line. This is very handy when testing my program. Does python have something similar? Thanks, Geoffrey -- http://mail.python.org/m