Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
98 views

I need to run python script with costly initialization (0.5 seconds). To mitigate initialization time multiple interpreters are pooled, so when need to execute arises, interpreter is taken from pool ...
JL0PD's user avatar
  • 4,768
-3 votes
1 answer
60 views

i have created a mini python tool to backup using mysqldump import os import subprocess from datetime import datetime from dotenv import load_dotenv,dotenv_values load_dotenv(dotenv_path="./...
shadowy figure's user avatar
0 votes
0 answers
59 views

im currently trying to call/run python file b from python file a and it works, although all terminals except cmd struggle to let me work within this new opened python file i.e. i can only seem to type ...
Mattka's user avatar
  • 45
1 vote
1 answer
144 views

So far I've seen: Python spawn off a child subprocess, detach, and exit Use the start_new_session parameter available since Python 3.2: [...] This will allow the parent process to exit while the ...
sdbbs's user avatar
  • 6,018
-1 votes
1 answer
83 views

I’m building an agentic AI around SUMO using Python (TraCI + randomTrips.py) on Windows. I’m facing an issue where randomTrips.py hangs indefinitely during traffic generation when executed ...
Vansh's user avatar
  • 19
-1 votes
3 answers
190 views

I would like to automate a task of running an application repeatedly using Python's subprocess. The application is called ltx, and I need to run it with the -h argument, for example: [~]$ ltx -h Note ...
GershwinX's user avatar
0 votes
0 answers
86 views

I'm running a DB2 stored procedure from Python using subprocess.run. The command works perfectly when I run it directly in my shell: db2 'CALL GET_DBSIZE_INFO(?, ?, ?, 0);' | awk -F': *' '/Parameter ...
Faraz's user avatar
  • 19
2 votes
1 answer
73 views

p = subprocess.Popen([ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", f"--remote-debugging-port={SOME_PORT_NUM}", "--no-...
Philip Adler's user avatar
  • 2,228
Best practices
1 vote
4 replies
148 views

I want to write a script which ends by calling my text editor (vim) on a specific file path. The file doesn't yet exist, and I want the editor window to already have some contents in it. In particular,...
Ted's user avatar
  • 1,102
0 votes
1 answer
182 views

I am trying to pipe multiple Linux commands and abort if there is an error. With Popen the communicate() method waits for all commands to finish. This is why I am trying asyncio now. I have the ...
Manuel Schmidt's user avatar
0 votes
1 answer
87 views

test.bat: @echo off for /L %%i in (40, -1, 10) do ( echo working %%i test1 ping localhost -n 2 > nul ) echo Done! main.py: import subprocess startupinfo = subprocess.STARTUPINFO() startupinfo....
Rhys's user avatar
  • 5,428
3 votes
2 answers
191 views

I am running python 3.13.5 via PowerShell in windows 10. I can successfully run the folowing command, and now want to run it with a python script & 'D:\realesrgan\realesrgan-ncnn-vulkan.exe' -i 'D:...
Christopher Pratt's user avatar
1 vote
0 answers
113 views

How would I be able to start a multiprocess when one of the tasks uses Asyncio and another task uses a subprocess to run? Here is the main function: import asyncio import aioprocessing import ...
Andrew Ryan's user avatar
  • 1,631
0 votes
0 answers
110 views

I'm running an utility for using kubernetes via the model context protocol. I can call it from the shell like this (using the uv tool utilities): uvx kubernetes-mcp-server --port 8080. I am spawning ...
FLKR's user avatar
  • 115
-4 votes
1 answer
103 views

I am writing a PIN code system whereby a particular PIN code is assigned to a particular solenoid lock. There are two files: File1: This file has a function in it where it takes the user input (PIN) ...
Paxton's user avatar
  • 1
0 votes
2 answers
101 views

I am using Pycharm. When I click the "stop" button, the subprocess.Popen deletes the left over .bat files. But after putting the subprocess.Popen inside a threading.Thread function, the .bat ...
Rhys's user avatar
  • 5,428
-1 votes
0 answers
41 views

I would like to launch the Python REPL as a subprocess, but it doesn't appear to work: import sys import subprocess p = subprocess.Popen([sys.executable], stdin=subprocess.PIPE, stdout=subprocess....
Wayne Werner's user avatar
  • 52.4k
11 votes
4 answers
827 views

I'm writing a Python script using subprocess to hardcode subtitles onto a video. My code builds a complex filter graph for ffmpeg's -vf argument, which includes burning in multiple layers of styled ...
phpjunkie's user avatar
  • 523
0 votes
1 answer
75 views

I have a python script that pings another device every so often. PING_SIZE = "1" PING_RETRYS = "1" while True: try: result = subprocess.run( ["ping&...
Thewafflication's user avatar
0 votes
0 answers
367 views

I was trying to launch chromium browser using remote-debugging-pipe in python, but there is a problem everytime I tried to do so, I am using this code, I got help from gemini and chatgpt but they don'...
Muhammad Ali's user avatar
0 votes
0 answers
57 views

VS Code Version: Version: 1.103.2 (user setup) Commit: 6f17636121051a53c88d3e605c491d22af2ba755 Date: 2025-08-20T16:45:34.255Z Electron: 37.2.3 ElectronBuildId: 12035395 Chromium: 138.0.7204.100 Node....
wicast's user avatar
  • 1
1 vote
1 answer
73 views

I made a batch file stopwatch. temp1.bat echo WAITED 3 SECONDS timeout /t 3 /nobreak >nul echo WAITED 5 SECONDS timeout /t 5 /nobreak >nul echo WAITED 6 SECONDS timeout /t 6 /nobreak >nul ...
Rhys's user avatar
  • 5,428
2 votes
2 answers
141 views

I reviewed the "similar questions", but those seem to refer to using the full path for ffmpeg to ensure using the same version, which I am already doing so posting my question. I am using a ...
Brian's user avatar
  • 133
2 votes
1 answer
98 views

I'm running a Python script inside a Conda-based Docker container that processes geospatial data. The script runs a two step GDAL workflow, it uses gdaldem colorrelief to create a colorized GeoTIFF, ...
mrotskcud's user avatar
1 vote
0 answers
96 views

I have some powershell script/command I wish to run form a node.js environment. But since the command is dependent on the 'AppUserModelID' it seems to fail since the command spawns a separate program (...
n247s's user avatar
  • 1,932
2 votes
1 answer
101 views

I am building a remote terminal with Python subprocess. Trying to capture the output and errors from subprocess.run(), and I'm having issues with an extra quote getting printed that should not be ...
ms32-org's user avatar
2 votes
0 answers
130 views

I'm writing a Python script that sends expressions to the bc command-line calculator using subprocess.Popen. I noticed a difference in behavior based on whether I use shell=True or not. When using ...
Alan's user avatar
  • 21
0 votes
0 answers
58 views

I am very new to python. My current project is to create a basic Tkinter window to start and stop a TCPdump Ethernet recording using a couple of buttons. I have been able to start a recording using a ...
SteveL's user avatar
  • 1
2 votes
1 answer
57 views

In short, I'm trying to run a python script from another python script but in the background, allowing the parent script to continue executing, and then to pass a CTRL_C_EVENT to the child script to ...
narab's user avatar
  • 29
-1 votes
1 answer
104 views

I'm working on PyInstaller Packaging. But subprocess isn't seem to be working. Subrocess part it getting stuck and not getting further. But i'm getting return code 0 error. Test.py import pandas ...
Krishna 's user avatar
1 vote
1 answer
67 views

The following code is supposed to stop the batch file counting down to ZERO when the KeyboardInterrupt error is called. But it is not doing so. with open('test.bat', 'w', encoding='utf-8') as file: ...
Rhys's user avatar
  • 5,428
-1 votes
1 answer
68 views

I have the a program running on a Raspberry Pi which, for the purpose of this question, can be boiled down to the following: import datetime import subprocess #Change system timzone subprocess.run('...
Kovy Jacob's user avatar
  • 1,183
-2 votes
1 answer
76 views

In my WSL 2 terminal, I am running a Python script that creates multiple subprocesses with Popen(<command>). The command I am passing in executes a makefile in a Docker container. When the ...
Caio DaSilva's user avatar
1 vote
0 answers
58 views

I have a fairly specific issue that I have been trying to solve for days to no avail. I have a Python script that opens archive files, decompresses them, and re-compresses them as zip files for ...
sven2388's user avatar
1 vote
1 answer
240 views

If I use the following Python code to get the output of PowerShell it works fine: def get_powershell_table(command): try: result = subprocess.run( ["powershell", &...
Binny's user avatar
  • 41
0 votes
1 answer
78 views

I have a python program on which I wanted to set memory limits with setrlimit. But after setting the RLIMIT_AS, some things will stop working: calling subprocesses making http requests def main(): ...
Bálint Balina's user avatar
0 votes
1 answer
69 views

I'm trying to execute commands on the shell via Python on Windows and Linux and noticed a significant difference: import subprocess r = subprocess.run("echo 1\r\necho 2", shell=True, ...
Schorschii's user avatar
0 votes
1 answer
210 views

I'm doing a data aggregation across multiple csv files. To save me some time, I have a python script developed that iterates through a series of subfolders and places a secondary script (called ...
MM3's user avatar
  • 1
2 votes
1 answer
49 views

I want to run a batch file using subprocess.Popen … then delete the batch file if I force exit (the red square STOP button in pycharm) with open('test.bat', "w", encoding='utf-8') as a: a....
Rhys's user avatar
  • 5,428
0 votes
1 answer
87 views

process = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) For the above subprocess the cmd is: cmd = ['/usr/bin/mkvmerge', '-o', 'temp', '--audio-tracks', '4', '/home/test/...
bob_the_bob's user avatar
0 votes
1 answer
309 views

ass_path = r'C:\Users\username\Desktop\Title Of Video.ass' command = [ 'ffmpeg', '-i', mp4_path, '-vf', f"ass='{ass_path}'", # Embed the full ...
Utopia's user avatar
  • 1
3 votes
2 answers
594 views

I am using FastAPI to make a GET request, which runs a .jar file that returns some text data. The GET request is triggered by a button press in the frontend. The Java program takes about 30 seconds to ...
Nick's user avatar
  • 31
1 vote
1 answer
112 views

I would like to wrap an external process with a python subprocess to add a control on the input and output. I created a small wrapper program, and managed to change the input and output send to the ...
Ori N's user avatar
  • 848
1 vote
1 answer
117 views

I have a script for my USB that i need to use on multiple devices, and i want it to auto-eject, and using this method, as long as it has elevated privileges it runs, no issues, no errors, but i check ...
Space-Coww's user avatar
0 votes
0 answers
102 views

I am working on an automated grading tool for student programming submissions. The process is: Students submit their code (Python projects). I clean and organise the submissions. I set up a separate ...
Ebrahim Al-Aghbari's user avatar
1 vote
2 answers
94 views

I write asynchronous process manager, and up till now I came up with this: import asyncio class AsyncLocalProcessManager: def __init__(self): self.process = None async def submit(...
IzaeDA's user avatar
  • 449
1 vote
0 answers
93 views

I'm trying to install the TA-Lib Python package in Google Colab for a stock prediction project, but the installation fails with a subprocess error: ERROR: Failed building wheel for ta-lib. The error ...
Suhas Kumar's user avatar
2 votes
0 answers
73 views

I'm facing an unusual issue when using subprocess.Popen in Python while debugging in VS Code. The behavior of the PATH environment variable changes only in debug mode, and subprocess calls behave ...
KLc3088's user avatar
  • 157
1 vote
1 answer
51 views

I'm computing neural networks with several .py files in spyder. I could sequencely execute them in spyder. However, the console do not show any thing like single file execution. For example, this is ...
yx feng's user avatar
  • 21
2 votes
1 answer
84 views

I want to use a Python script to ssh to a remote server I own and source a script called "admin_environment". The interactive part is required because I need to enter a password once this ...
Roberto_1986's user avatar

1
2 3 4 5
247