Translating a Perl script into Python

Erno Kuusela erno-news at erno.iki.fi
Sat Jan 20 03:26:58 EST 2001


In article <slrn96igh4.q4j.grey at teleute.dmiyu.org>,
grey at despair.rpglink.com (Steve Lamb) writes:

| On Sat, 20 Jan 2001 07:13:25 GMT, Sheila King <sheila at spamcop.net> wrote:
|| open PROC, ">proc.test" || die "Couldn't open file for write: $!";

|| Is the closest I can get in Python, to a Perl "die" statement, is to use
|| exceptions? (I'm directing this to the group, not just Erno, as I realize he
|| may not know Perl.

|     Off the top of my head, might not be the best way...
[...]
|     proc = os.open(file,O_WRONLY)

why os.open()? i think that would correspond to perl's sysopen function.

  -- erno



More information about the Python-list mailing list