Re: Perl __DATA__ construct.

2012-06-25 Thread Miki Tebeka
> Is there a way to do the same thing in Python? Not without some clever tricks. Either you store data at the beginning of the file or you have another file with the data. If you really need one file and data at the end, you can roll your own. Something like: def data(): with open(__

Re: Perl __DATA__ construct.

2012-06-25 Thread Benjamin Kaplan
On Mon, Jun 25, 2012 at 2:20 PM, Mladen Gogala wrote: > I have a script in Perl that I need to rewrite to Python. The script > contains __DATA__ at the end of the script, which enables Perl to access > all the data after that through a file descriptor, like this: > > usage() if ( !$stat or !define

Perl __DATA__ construct.

2012-06-25 Thread Mladen Gogala
I have a script in Perl that I need to rewrite to Python. The script contains __DATA__ at the end of the script, which enables Perl to access all the data after that through a file descriptor, like this: usage() if ( !$stat or !defined($home) or !defined($base) or !defined ($sid) ); while () {