I'm writing a (somewhat) modular application in Python 3 and I'd like to run arbitrary programs from it, said program being specified at runtime and not necessarily a python script.
So I use for example,
subprocess.call([spam, "-i", eggs, "-o", ham])
If spam
is a python script, with shebang to python3
and executable rights, I get
OSError: [Errno 8] Exec format error
if I
subprocess.call(["python3", spam, "-i", eggs, "-o", ham])
it works fine.
Do you know why? How can I run spam
without specifying python3
?