Python end of file marker similar to perl's __END__

beginner zyzhu2000 at gmail.com
Wed Aug 1 09:57:36 EDT 2007


On Jul 31, 10:53 pm, beginner <zyzhu2... at gmail.com> 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?
>
> Thanks,
> Geoffrey

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 code I am debugging and do not have to
worry about some bad syntax down the line. This feature is especially
handy if I am, saying, replacing modoules or changing data structures.





More information about the Python-list mailing list