Wrap a function
drsalists at gmail.com
Wed Feb 3 21:41:43 CET 2010
Ben Finney wrote:
> Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
>> On Thu, 28 Jan 2010 11:24:28 -0800 (PST), Joan Miller:
>>> On 28 ene, 19:16, Josh Holland <j... at joshh.co.uk> wrote:
>>>> Check the docs on os.system().
>>> No. I've a function that uses subprocess to run commands on the same
>>> shell and so substitute to bash scrips. But a script full of run
>>> ("shell_command --with --arguments") is too verbose.
>> I shall blaspheme, and suggest that maybe the language you want
>> to use is REXX (ooREXX or Regina).
> Heh. That isn't blasphemy, because no true Pythonista  would claim
> Python to be the god of that domain.
> It's no sin to say that Python isn't a good choice for specific things;
> and “I want to write programs by indistinguishably mixing statements
> with external system calls” is one of them, IMO
A quick note on terminology: open() is typically a system call.
fopen is probably never a system call - instead, it is a function in
the C library that wraps open(), making open() easier to use. Then
there's the system() function - like fopen(), it isn't really a
system call, despite its name. Rather, it is a C library function
that typically will wrap the fork() and exec*() system calls.
More information about the Python-list