473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

On Wed, Oct 22, 2008 at 10:32 AM, gita ziabari <gi*********@gmail.comwrote:
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"
Oct 22 '08 #1
1 1732
James Mills wrote:
Directly importing a bash function into python is not
possible.
Well, you could write a bash interpreter in Python...
but that's probably more work than it's worth

--
Greg
Oct 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tlo | last post by:
hello, i would like to do the following, and as i had never used python in a network framework i would like to have opinions on this : i would like to provide some kind of network quizz game,...
0
by: python-help-bounces | last post by:
Your message for python-help@python.org, the Python programming language assistance line, has been received and is being delivered. This automated response is sent to those of you new to...
0
by: python-help-bounces | last post by:
Your mail to 'Python-Help' with the subject ello! =)) Is being held until the list moderator can review it for approval. The reason it is being held: Message has a suspicious header
0
by: Leeds, Mark | last post by:
This is a follow up question To the previous question About sorting that I sent for my friend. -----Original Message-----
1
by: praba kar | last post by:
Dear All, In Php I can use strip_tags() function to strip out all html tags. I want to know that strip_tags() equivalent function in Python. regards praba ...
3
by: mark | last post by:
is it possible to call a php function from python and use a class from php in python? i want to use mmslib which creates mms messages and the only implementation is a php mmslib implementation....
1
by: Sue Velutty | last post by:
Hi, I'm having this errror when I try to run "import _tkinter" in python Python 2.2.2 (#1, Apr 5 2007, 12:58:53) on linux2 Type "help", "copyright", "credits" or "license" for more...
17
by: DanielJohnson | last post by:
how to use the combination function in python ? For example 9 choose 2 (written as 9C2) = 9!/7!*2!=36 Please help, I couldnt find the function through help.
9
by: grbgooglefan | last post by:
I am trying to pass a C++ object to Python function. This Python function then calls another C++ function which then uses this C++ object to call methods of that object's class. I tried...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.