Category "subprocess"

How to start stop windows service without admin rights prompt in Python?

I have tried various solutions given in the links below to start, stop Windows Service (rabbitmq) in a PyTest without any admin rights prompt (so it can run con

Registry query not working with subprocess command

When I enter this in my CMD, it works fine: reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /v BackupProductKeyDefault

Behavior of Python subprocess on django+nginx

I have a simple code like: subprocess.run( ["python3", "action.py", "--options"] ) In action.py I import some packages, perform a small script It

how to use python variables in bash script inside python script

I am trying to use my python variables inside the bash script in the python script as below... import os import submodule URL="http://wmqa.blob.core.windows.net

Subprocess $Env:Path python: The filename, directory name, or volume label syntax is incorrect

I am trying to change the windows environment variables, but I am having trouble doing so. Before I tried to use os.environ() I tried out using powershell comma

How do I close one specific csv file that is open in the excel application on windows using python, given the path to that file?

I have a script that writes data to a csv file, but if that csv file is open (in the excel application on Windows 10) then it generates a PermissionError. This

Actual meaning of 'shell=True' in subprocess

I am calling different processes with the subprocess module. However, I have a question. In the following codes: callProcess = subprocess.Popen(['ls', '-l'],

how to restart subprocess if it crashes?

I'm trying to restart a subprocess if it crashes, but somewhy this loop just doesn't work. I've been wondering if that's even possible? def dont_stop(conv):

Running subprocess.Popen in a compiled script has a significant delay

Edit: In this specific example, Python 3.8 is being used on Windows 10. I need to run FFprobe through subprocess.Popen so I can capture and parse the output. If

How to kill a subprocess when it goes interactive in Python

I need to run several subprocess.run in a loop. Most of the time, if the exe called in the subprocess succeed nothing happen. But in some cases, usually when so

OSError: [Errno 63] File name too long while calling python subprocess

While running the following code I'm getting file name too long import subprocess import json data = [{ "id": 1, "first_name": "Janet", "last_name": "Til

What is the encoding of CompletedProcess.stdout coming from Powershell/Windows in Python?

I am getting this output from a ping request started from Python with subprocess.run(): >>> process.stdout b"\r\nEnvoi d'une requ\x88te 'ping' sur www.

How to catch a FFMPEG exception with subprocess?

I'm doing some work on subtitles and some videos have 1 subtitle track, others have 2 subtitle tracks. For those that have 2, I use the 2nd one (index = 1). I'm

Why is C++ getline() non-blocking when program is called from python subprocess?

I have a C++ program that waits for some text input with getline(), and it works well from the command line. However, I would like to call it from Python - send

Python subprocess line 1420 FileNotFoundError: [WinError 2] The system cannot find the file specified. Jupyter-Matlab notebook

I want to use Jupyter-matlab notebooks. I've downloaded Anaconda navigator and followed the steps from this web: http://jmlilly.net/jupyter-matlab Unfortunately

Unable to call subprocess with command that works from cli [duplicate]

The following command works fine from the CLI: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r /path/coverage.xml When I pas

subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1 [duplicate]

I was trying to install the dlib package for my face recognition project but error keep getting in the way. This is another error and I don't

Process the output of python subprocess

I'm trying to make a system call in Python and store the output to a string so that I can process it in my Python program.To be more specific of what i am doing

Problem of running samtools in python using subprocess.run()

I'm using subprocesss.run() to run samtools command in python. The code is as below: result = subprocess.run(['samtools', 'faidx', 'hg38.fa.gz', 'chr1:169699712

Subprocess loop in python

I have a folder with a few hundred .bed files that I want to loop over to extract fasta sequences. In the terminal, my command is: twoBitToFa -bed=PA2_03_2bit.b