import a function from bash to python? -HELP!-

James Mills prologic at shortcircuit.net.au
Tue Oct 21 20:57:38 EDT 2008


On Wed, Oct 22, 2008 at 10:32 AM, gita ziabari <gitaziabari at gmail.com> wrote:
> Is is possible to import a function from bash to python? If so, what is the
> syntax and how should I pass the input parameters?

The only possibility is to use the subprocess module
and this is a more general problem, one involving the
invocation of external processes to perform some work
for you and get the resutls.

Read: pydoc subprocess

Directly importing a bash function into python is not
possible. Write a bash script, then call it with subprocess.

--JamesMills

-- 
--
-- "Problems are solved by method"



More information about the Python-list mailing list