Python Command Line Input Args equivalent to Perl

Edward WIJAYA ewijaya at i2r.a-star.edu.g
Thu Oct 28 01:43:46 EDT 2004


Hi,

I am new to Python, and I like to
learn more about it. Since I am
used to Perl before, I would like
to know what is Python equivalent
of Perl code below:


$filename = $ARGV[0];
open (FILE,"$filename") || die "Can't Open $filename:
$!\n";
while<FILE>{ #dealing with it per-lines
    #process something here
}


Also where can I find in any pointer/website
link ofPerl-Python concordance,
especially to facilitate Perl conversion to Python.

Thanks so much for your time.
Hope to hear from you again.

-- 
Regards,
Edward WIJAYA
SINGAPORE



More information about the Python-list mailing list