All Questions
Tagged with stdin subprocess
152
questions
2
votes
0
answers
38
views
Writes to child subprocess.Popen.stdin don't work from within process group?
From within a Python script, I'm launching an executable in a subprocess (for anyone interested: it's the terraria server).
# script.py
server_process = subprocess.Popen("my_executable arg1 arg2&...
0
votes
1
answer
35
views
Calling bash from python subprocess maintaining context, returning results and printing to screen
I have a function that sends a statement to bash. It prints the output in real time to the console and also returns the value. It works flawlessly and looks like this:
def call_in_bash(statement):
...
-1
votes
1
answer
97
views
One-way communication in python
For the last day I've been trying to get some one-way continuous communication between two python scripts as an exercise for a bigger project. However, subprocess.communicate only allows a one-time ...
0
votes
1
answer
38
views
Python Popen Subprocess - interacting with executable not possible until stdin is closed
I am trying to interact with a Commandline Executable, but I am stucked.
I would like to print out every line, the .exe is producing to stdout.
Until I get "condition" in a line -> then ...
0
votes
1
answer
199
views
How to connect the stdin streams of parent and child processes?
I have problem to write stdin in deno version 1.37.0 (release, x86_64-pc-windows-msvc). I search in documentation, google, try the code and not work. I found related code in https://github.com/...
0
votes
0
answers
51
views
why the subprocess.run with ssh closed parent process' stdin pipe
I have 2 python scripts:
# foo.py
import time
import subprocess
from multiprocessing import Process
def foo():
subprocess.run(["ssh", "localhost", "sleep", "10&...
1
vote
0
answers
53
views
Pipeing input to a Java process from Python - Java process does not receive input
I have a Java process that has the following logic:
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String line;
LOGGER.info("...
1
vote
1
answer
93
views
How to prevent piping to `less` in Rust from overwriting the shell prompt?
Running this program:
use std::process::{Command, Stdio};
use std::io::{self, Write};
fn main() -> io::Result<()> {
let mut child = Command::new("less")
.args(["--...
0
votes
0
answers
33
views
How can I send and argument to a C code from a Python code
I have a Python code that compiles and executes another C file. The thing is, how can I do to send arguments? The C code is a text processer, so it waits for text in order to process it and give an ...
1
vote
1
answer
113
views
How to pass an argument to the subprocess that expects input
I would like to execute a "git push" command using Python script. I was hoping to achieve this by using python's subprocess.Popen() method. However when I invoke the "git push" ...
3
votes
1
answer
399
views
How to capture interlaced stdin and stdout from a Python subprocess
I am trying to write a Python script that automatically grades a Python script submitted by a student, where the student's script uses the input() function to get some information from the user.
...
2
votes
1
answer
783
views
Rust and Python subprocess module with stdin.readline
Minimal reproducible example
I have created a minimal reproducible example that can be cloned and easily ran on Github for testing: https://github.com/VirxEC/python-no-run
If you don't want to go to ...
1
vote
1
answer
82
views
Interact with python using subprocess
I try to interact to python interpreter using subprocess module like this :
import subprocess
def start(executable_file):
return subprocess.Popen(
executable_file,
stdin=...
1
vote
0
answers
19
views
sub script stdin prompt text display after user input content when using subprocess popen
I am trying to write one script to read the output of another py file. and because the calling py file may have some input. So in main python file, I would handle the stdin.
I got one strange ...
0
votes
1
answer
374
views
Prevent Popen from freezing when waiting for input
What:
I am creating a custom console for an application I am making that has to handle processes (I/O) and its UI.
Why:
I am using Tkinter as the UI library. This needs an active main loop in order ...