Perl 文件 1.pl:
#!/usr/local/bin/perl -w
($b) = @ARGV;
$a = 1;
$c = $a + $b;
print "$c\n";
exit;
python文件1.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
b = 2
res = subprocess.call(["perl", "1.pl", str(b)])
print res
签出
$python 1.py
输出:
3
0
输出应该是 3,那怎么了?