November 2001
Beginner
320 pages
5h 53m
English
The Python sys module provides us with the interface for determining information about the machine and environment in which Python is currently executing. Some of these elements are handled in Perl using built-in variables, others by built-in functions. We'll have a look at all of the compatibility information, and how to make the transition from using one system to another, as well as some of the Python specific elements.
Within Perl any arguments supplied to the script on the command line are supplied in the standard @ARGV variable. For example, we can accept a list of files to process using:
foreach my $file (@ARGV)
{
print "Processing $file\n";
...
}
Under Python you must import ...