Tagged Questions
0
votes
1answer
26 views
python subprocess module to call shell (Bash) script
I am trying to call a shell (Bash) script from python. The script is in my /home/user/bin directory with execute permission for group & user, i.e., -rwxr-xr--. I am using ...
0
votes
1answer
21 views
Using 2 cd() calls in the same Fabric execution
I recently asked for explanations about a Fabric script behavior I couldn't understand. Now that I understand how Fabric works, I am still struggling to find a solution to my problem :-)
Basically, I ...
0
votes
3answers
32 views
ssh using sshpass in python seems to not work
I have a python script which is supposed to ssh in to a client and execute a bash from the client. As a test scenario I am using just 1 machine to connect but the objective is to connect to several ...
0
votes
2answers
28 views
Use awk/sed scripting to extract function parameters
I have Python code from which I want to extract HTTP parameters.
In the following: how can I leave the def lines alone, but from remaining lines preserve only what is within params['...'] perhaps ...
0
votes
1answer
16 views
Supervisord - Start a backgroup python script
I create bash to run python script start_queue.sh
content of start_queue.sh
python /tmp/my_python_script.py &
It's work when I run it in terminal. But I want to manage it using supervisord ...
0
votes
2answers
44 views
How can i let the BASH script run as process? So that even the Python script is killed the BASH script runs forever?
I need to track and launch few BASH scripts as process (if they for some reason crashed or etc). So i was trying as below: but not working
def ps(self, command):
process = ...
0
votes
1answer
18 views
Python - running a file listener when system boot till system switched off to do some automated actions, but not working
I have to read a file forever such as when system boot and till end. Based on the file events python script has to take actions. But its weired that my python script is not doing so.
Step 1: crontab ...
3
votes
1answer
27 views
using an alternate /tmp location with pyinstaller
I have a Python script which I then ran through pyinstaller2.0 to generate its binary.
python pyinstaller -F /path/to/python/script
While running the binary, it uses the /tmp folder by default to ...
1
vote
2answers
94 views
Speed up Python script's for loop
Assuming you got something like this (copied from here):
#!/usr/bin/python
from scapy.all import *
TIMEOUT = 2
conf.verb = 0
for ip in range(0, 256):
packet = IP(dst="192.168.0." + str(ip), ...
0
votes
1answer
57 views
How to bind CUPS printer to user?
Following situation:
We are using LDAP/GOSA for managing users and their printers
I use a perl script to extract the user-datas from LDAP and parse it into a yaml-file (at each login of a user)
I ...
1
vote
3answers
58 views
Running a command completely indepenently from script
I have recently come across some situations where I want to start a command completely independently, and in a different process then the script, equivalent typing it into a terminal, or more ...
0
votes
1answer
38 views
How do I execute a complex shell find command from Python?
I'm trying to execute a complex shell command from inside of python. The naive attempt:
subprocess.call(["find", ".", "-exec touch {} \;"], cwd=".")
is failing. How do I go about doing this?
0
votes
2answers
36 views
Search multiple strings in multiple files [closed]
I have a file messages.txt with 100 or so lines, and I want to search inside all files of a given directory for occurrences of any of the lines in messages.txt. The search must be recursive.
It would ...
-2
votes
1answer
47 views
Best choice to parse multiples CSV files depending on their names with multiple entries
I am doing simulation for my research and I get as output multiples CSV files (depending on the number of parameters that I set up).The file's name would be param1_param2_...._paramx.csv. So finally I ...
0
votes
0answers
42 views
Parse terminal prompt and enter input programmatically
In my Python script, I have the following bash prompt from an API call:
URL: http://urlhere.com/aBcDeFg (URL always different)
Input: << (able to enter input here)
The URL has information ...