I'm learning python and perl and i was trying to run from python a perl script using the subprocess module.
I have an issue that i don't understand regarding this.
I run this code:
First part : run grep, works as expected, i can get the ouput and display it.
The second one, when i actually want to run the perl script and get the output throws me an error :
I don't understand why this happens since the code is similar. Can someone enlight me?
Thanks,
Ionut
Last edited by capitanui; 10-23-2013 at 08:36 AM..
Reason: Solved - Wrong spelling .. didn't saw it
I am writing a shell script that executes another script by fetching it over the network and piping its contents into sh (ftp -o - $script | sh; or wget -O - |sh). Since this bypasses putting the script on the filesystem, this means I can't source the script directly (using . ), but rather it... (1 Reply)
Hi All
Here i have a piece of code,
set filename "./GopiRun.sh"
#I need to wait here until the GopiRun.sh is completed how do i achive this
exit. (1 Reply)
Hi,
I am having a trivial doubt. Please see the below pipeline code sequence.
command1 | (command 2; commend 3)
I am aware that the command that follows pipe will run in the sub shell by the Unix kernel. But how about here? Since these set of commands are grouped under "parantheses", will... (6 Replies)
Hi Guys,
Just a question about subprocesses.. Lately one of our servers has started to throw out the following error:
SYSTEM ERROR: Too many subprocesses, cannot fork. Errno=12
We've already increased the threshold twice. Its now up to 8000 and the swap space has also been increased. We... (6 Replies)
Hi,
I am trying to run a shell script using subprocess in python.
I can run simple script with arguments using subprocess.But I am not able to embed xterm in subrocess command.
#!/usr/bin/python
import subprocess
subprocess.call()
Above code gives me error.
Please help me in... (2 Replies)
After struggling with this for days now, I'm reaching out to the experts of all things linux for some help with this.
I'm trying to run the following working command (on command line) inside a python script using subprocess:
rsync -avzh --no-perms --delete --include="*sub*" --exclude='*'... (2 Replies)
So I have this basic script, see below
import subprocess
import shlex
command = "gcloud projects list"
subprocess.check_output(shlex.split(command))
subprocess.check_call(shlex.split(command))
The subprocess.check_call(shlex.split(command)) actually return what I expect. It returns... (6 Replies)
Discussion started by: scj2012
6 Replies
LEARN ABOUT DEBIAN
python-config
PYTHON-CONFIG(1) General Commands Manual PYTHON-CONFIG(1)NAME
python-config - output build options for python C/C++ extensions or embedding
SYNOPSIS
python-config [ --prefix ] [ --exec-prefix ] [ --includes ] [ --libs ] [ --cflags ] [ --ldflags ] [ --extension-suffix ] [ --configdir ] [
--help ]
DESCRIPTION
python-config helps compiling and linking programs, which embed the Python interpreter, or extension modules that can be loaded dynamically
(at run time) into the interpreter.
OPTIONS --cflags
print the C compiler flags.
--ldflags
print the flags that should be passed to the linker.
--includes
similar to --cflags but only with -I options (path to python header files).
--libs similar to --ldflags but only with -l options (used libraries).
--prefix
prints the prefix (base directory) under which python can be found.
--exec-prefix
print the prefix used for executable program directories (such as bin, sbin, etc).
--extension-suffix
print suffix used for extension modules (including the _d modified for debug builds).
--configdir
prints the path to the configuration directory under which the Makefile, etc. can be found).
--help print the usage message.
EXAMPLES
To build the singe-file c program prog against the python library, use
gcc $(python-config --cflags --ldflags) progr.cpp -o progr.cpp
The same in a makefile:
CFLAGS+=$(shell python-config --cflags)
LDFLAGS+=$(shell python-config --ldflags)
all: progr
To build a dynamically loadable python module, use
gcc $(python-config --cflags --ldflags) -shared -fPIC progr.cpp -o progr.so
SEE ALSO
python (1)
http://docs.python.org/extending/extending.html
/usr/share/doc/python/faq/extending.html
AUTHORS
This manual page was written by Johann Felix Soden <johfel@gmx.de> for the Debian project (and may be used by others).
November 27, 2011 PYTHON-CONFIG(1)