Possible Duplicate:
Equivalent of Backticks in Python
When I want to write directly to the command prompt in Perl, I can do something like this:
Perl File test.pl:
$directory = `dir`;
print $directory;
Which would output something like..
C:\Documents and Settings\joslim\Desktop>perl test.pl
Volume in drive C has no label. Volume Serial Number is EC37-EB31
Directory of C:\Documents and Settings\joslim\Desktop
(and a listing of all the files..)
Can I do this in Python? I've searched around but have had no luck.
Also, can you tell me what this is called? I'm sure there's a more technical term than "writing directly to the command prompt"...