Tagged articles
subprocess
14 articles · Page 1 of 1
The article explains why Symfony Process loses colored output and progress bars when commands are run from PHP, describes the underlying STDIN/STDOUT/STDERR handling, and shows how setTty(true) and setPty(true) can restore terminal behavior with code examples.
command-lineprocesspty
0 likes · 7 min read

Python 3.14 introduces a collection of subtle yet useful enhancements—such as TypedDict's NotRequired, improved static analysis, lazy imports, clearer error messages, a new contextlib.chdir manager, refined async task cancellation, better subprocess isolation, richer pattern‑matching errors, and import‑time profiling—that together make scripts run smoother, easier to debug, and more maintainable.
3.14PythonTypedDict
0 likes · 7 min read

Learn nine distinct Python approaches for copying files—including shutil functions, os commands, threading, and subprocess methods—while understanding their performance implications, error handling, platform compatibility, and when to choose each technique for optimal I/O efficiency.
File I/Ocopyfileshutil
0 likes · 12 min read

This article explains why limiting a function's execution time is crucial for stability, and demonstrates multiple Python techniques—including the func-timeout library, custom multiprocessing, subprocess.run, and signal handling—to set and manage timeouts effectively.
PythonSignalerror handling
0 likes · 8 min read

Learn how to effectively use Python 3’s subprocess.run() function—including the powerful check=True option—to execute system commands, capture output, handle errors, and leverage key parameters such as stdout, stderr, text, and capture_output, with practical code examples and best‑practice guidelines.
Code Exampleserror handlingsubprocess
0 likes · 7 min read

This tutorial explores nine different Python approaches—including shutil, os, threading, and subprocess—to copy files, explaining their behavior, performance implications, error handling, and platform considerations so you can choose the most suitable method for your application.
file copyosshutil
0 likes · 12 min read

This guide shows how to list and export all saved WiFi profiles on a Windows PC via the command prompt and a Python script, explains the use of the subprocess module for executing system commands, and includes notes on UTF‑8 handling and related code examples.
PythonWiFicmd
0 likes · 7 min read

This article explains how to use a Python script that continuously pings an external address and automatically logs into a campus web authentication portal via HTTP POST when the connection drops, ensuring the computer stays online for remote access, and provides the full source code and setup instructions.
Base64Campus WiFiHTTP POST
0 likes · 4 min read

This article explains how the Python subprocess module is employed in a data construction platform, compares run and Popen methods, discusses challenges such as incomplete log capture and process termination, and presents three practical solutions to ensure reliable execution and logging.
Backendprocess-managementpsutil
0 likes · 9 min read

This article explains why Python's subprocess.Popen can deadlock when the child process writes more data than the system pipe buffer (typically 4 MiB), and demonstrates practical solutions such as avoiding PIPE, using communicate(), and streaming output with StringIO to prevent the blockage.
PipeStringIOcommunicate
0 likes · 6 min read

This article explains Python's built‑in methods for invoking shell commands—including os.system, os.popen, the commands module, and the subprocess module—detailing their return values, usage examples, and when to choose each approach for capturing command output.
Command ExecutionOS moduleshell
0 likes · 4 min read

This article explains four Python techniques—os.system, os.popen, the commands module, and subprocess—for running shell commands, comparing their ability to capture output, return status, and recommending subprocess as the most flexible modern solution.
Pythoncommandsos
0 likes · 3 min read

The article analyzes a rare blocking issue in a Python Agent where a subprocess created via subprocess.Popen hangs due to an unclosed pipe inherited by a forked child process, demonstrates debugging steps using thread frames and lsof, and provides a reproducible example and mitigation recommendations.
DebuggingLinuxPipe
0 likes · 10 min read

This guide explains multiple methods for executing external programs and scripts from Python on Windows, covering the simple os.system call, the win32api ShellExecute function, creating processes with win32process.CreateProcess, and invoking kernel32.dll functions via ctypes, complete with syntax, parameters, and example code.
ctypessubprocesswin32api
0 likes · 5 min read
