Asyncio stream process data with pipe between two subprocesses

Hello I can’t find a solution for the example here. I found but there is no stream reading. I’d like to run two subprocesses independent of python program (…

Unable to use subprocess in my colab python code

as part of a project I am doing wity Yolov4, I am trying to test multiple images with learned weights and copy the resulting images with added bounding boxes to my google drive. The following is the …

python: subprocess returns nothing when running scripts which take longer time

Beginner here with subrpocess problem: The below line works fine when I run both the scripts with less data which takes around 10-20minutes, however with bigger data to be processed the subprocess …

I am unable to check the files available in the directory

I am trying to read the csv files in the current directory. In-order to do that, I want to check all the files present in my current directory. I have tried doing it with check_output function. However, i received this error and I’m unable to figure out how to deal with it. This is the code I have tried: this is the error i have received: Answer You can get a list of all the files in the current directory by doing this:

python3.7 subprocess failed to delete files for me

I have a python script using ‘subprocess’ running linux command to confirm my task is doing the right thing, and it worked well. But i found that at the same time it will generate some log files when running my task. So i added a clean up function to rm log files for me at the beginning. My script is: but it turns out it did not remove log files for me after i added first test, it still have more and more logs file in my build dir. I run it using: My question is: 1. Why did not

Python loadarff fails for string attributes

I am trying to load an arff file using Python’s ‘loadarff’ function from The file has string attributes and it is giving the following error. >>> data,meta = arff.loadarff(…

Is there a way to get the error raised from a Python program outside Docker container and handle it?

I have a container that runs a Python program and it can run in two ways, using docker exec in the localhost terminal or by making an API Rest request (that is outside the container) which executes the same command as it would be done by using the first method. What I am trying to do is whenever my Python program inside the container raises an error the API notice it. The error handling that is being done in the Python program is using logging.exception to print an error message and the traceback in terminal and in the API I

How do I run a PowerShell script with parameters from Python

I’m trying to run PowerShell scripts that have parameters from Python 3.7.3, but don’t know how to properly call the function in Popen What I’m trying to do with my PowerShell script is login to …

Python Subprocess Module | Postgres pg_dump with password

I have a database that I want to back up with my a python code. I tried to base my code from the code in this discussion that uses the subprocess module and pg_dump. My problem now is that I have to …

AWS sync parameters not specified when AWS-CLI is run as a subprocess in Python

I have an AWS S3 bucket filled with data parameterized by date. I’d like to extract that data one date at a time using the AWS CLI (reference), specifically the aws s3 sync command. The following command does what I expect it to do: aws s3 sync s3://my-bucket-1 . –exclude “*” –include “*2018-01-17*” –dryrun Running this command from my command line generates a (dryrun) download for every file in my bucket containing the substring 2018-01-17. Great! To simplify the necessary file operations, I’ve written a small CLI wrapper around this executor. This wrapper is in Python, and uses the