Anything similar to __END__ in perl
Karsten Hilbert
Karsten.Hilbert at gmx.net
Fri Dec 8 05:28:53 EST 2017
On Fri, Dec 08, 2017 at 02:19:13AM -0800, Rustom Mody wrote:
> > > Hi, perl has __END__ which ignore all the lines below it.
> > >
> > > Is there anything similar to __END__ in python? Thanks.
> >
> > Something similar is:
> >
> > import sys
> > sys.exit()
>
> That will give syntax (or something) errors for what follows
True enough, didn't think of that. However, OP asked for
something _similar_ :-)
Which proves that any answer needs a definition of "similar" by OP.
Or at least: how similar is similar _enough_ to __END__ in Perl.
Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
More information about the Python-list
mailing list