Skip to main content

All Questions

Tagged with
1vote
1answer
2kviews

Python script: wait until job in tmux session has completed

I am trying to continuously run a python script with random parameters from another python script, where each run is in its own tmux session. A very simplified overview of what I'm trying to do goes ...
0votes
1answer
2kviews

permission needed for Python to access USB drive?

I got this Python script that reads media files from USB stick. It used to run fine, today it keeps giving me OS Error: [Errno 13] Permission denied: media/myName/usbName when the script runs the ...
3votes
2answers
2kviews

Script or Program to discover hosts on network

Explanation: I need a script or program to discover devices on my network. I was thinking maybe doing the scan with nmap and I need to display just the name of device, what it is, and also the ip ...
4votes
7answers
9kviews

Convert a list of decimal values in a text file into hex format

I have a need to convert a list of decimal values in a text file into hex format, so for example test.txt might contain: 131072 196608 262144 327680 393216 ... the output should be list of hex ...
0votes
1answer
3kviews

cannot execute python script as sudo from command line

I have a centos 7 VM and I need sudo permissions to run certain shell commands in a python script. I have a #!/usr/bin/env python3.7 at the top of my script and running it as sudo ./script.py gives me ...
21votes
8answers
165kviews

how to execute a bash command in a python script

How can I launch a bash command with multiple args (for example "sudo apt update") from a python script?
0votes
1answer
706views

Shell scripting, reading a list from tt file, use as variable, use the variable to run python scripts in a foor loop

I am trying to run a shell script where it reads the variables from a txt file, uses that variable in a for loop to run python file. The code reads a txt file where at least there are 100 variable ...
1vote
1answer
706views

Simulating Keystrokes to a Telnet process

On my Linux system I have opened a Telnet session. On the other tab I am running a Python script and giving commands to the Telnet session using mkfifo file redirection. But I am not able to simulate ...
0votes
2answers
95views

Renaming script not working after upgrading. Need a new one

Recursive file renamer - very useful python script stops working after upgrade Python (Pyt2 to Pyt3). Can anyone find and fix the problem please? Thank you! Example, those files: 'Linux příručka ...
0votes
1answer
1kviews

Shell script that prompts user for arguments and inserts them as parameters into a python script

I am trying to write a shell script that prompts the user for 3 case-sensitive arguments username password url and then take those parameters and calls a python script i.e.: "python streamcount....
4votes
3answers
823views

Need to remove files older then 90 days with an exception of last day of the month

Need help in deleting files from unix directory which are older then 90 days, but need to retain files which belongs to end of the month date. (ex: 28th Feb 2022, 31th march, 30th April ) for Ex: I ...
0votes
2answers
185views

How to use mountpoint to verify multiple directories using variables shell/py

if trying to automated this checks, how would py function work with shell def success(): print("### ####end") print("###end") # It can be called when the script fails ...
7votes
4answers
4kviews

Problems running python script from motion

I'm trying to set up the raspberry pi with my webcam as a motion detecting cctv that uploads the videos to google drive using Jeremy Blythe's script I have motion working correctly and the python ...
0votes
4answers
2kviews

Using two variables to form a single text file

I am trying to create a text file with below content user name is ${name} and his mobile number is ${number} I have 10 users and 10 mobile numbers as well. User names are saved in user.txt and the ...
1vote
1answer
1kviews

Recursive (batch) video codec details with MediaInfo CLI

I want to share my script to do this with Media Info CLI and python. At first I tried with pure bash but should have just gone python at first, much quicker and adaptable (for me). My task was to ...

153050per page
close