Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

stdin

How do I pass a string into subprocess.Popen (using the stdin argument)?

August 21, 2022 by Magenaut

If I do the following:

Categories Python, Q&A Tags python, stdin, subprocess Leave a comment

How do I write to a Python subprocess’ stdin?

August 21, 2022 by Magenaut

I’m trying to write a Python script that starts a subprocess, and writes to the subprocess stdin. I’d also like to be able to determine an action to be taken if the subprocess crashes.

Categories Python, Q&A Tags nuke, python, stdin, subprocess Leave a comment

Setting smaller buffer size for sys.stdin?

August 20, 2022 by Magenaut

I’m running memcached with the following bash command pattern:

Categories Python, Q&A Tags buffering, python, stdin Leave a comment

How to open every file in a folder

August 19, 2022 by Magenaut

I have a python script parse.py, which in the script open a file, say file1, and then do something maybe print out the total number of characters.

Categories Python, Q&A Tags file, pipe, python, stdin, stdout Leave a comment

Interactive input/output using Python

August 18, 2022 by Magenaut

I have a program that interacts with the user (acts like a shell), and I want to run it using the Python subprocess module interactively.
That means, I want the possibility to write to standard input and immediately get the output from standard output. I tried many solutions offered here, but none of them seems to work for my needs.

Categories Python, Q&A Tags interactive, python, stdin, stdout, subprocess Leave a comment

Multiple inputs and outputs in python subprocess communicate

August 17, 2022 by Magenaut

I need to do something like this post, but I need to create a subprocess that can be given input and give output many times. The accepted answer of that post has good code…

Categories Python, Q&A Tags pexpect, python, stdin, stdout, subprocess Leave a comment

How do I check if stdin has some data?

August 15, 2022 by Magenaut

In Python, how do you check if sys.stdin has data or not?

Categories Python, Q&A Tags python, redirect, stdin, stdout Leave a comment

Python 3: How to specify stdin encoding

August 12, 2022 by Magenaut

While porting code from Python 2 to Python 3, I run into this problem when reading UTF-8 text from standard input. In Python 2, this works fine:

Categories Python, Q&A Tags encoding, python, python-3.x, stdin, unicode Leave a comment

How can a command have more than one output?

August 10, 2022 by Magenaut

In this answer, at the very bottom, Gilles mentions that a command can have more than one output or input.

Categories Q&A, Unix & Linux Tags io-redirection, stdin, stdout Leave a comment

How to pass password to mysql command line

August 10, 2022 by Magenaut

I have MySQL password saved on a file foo.php, for example P455w0rd, when I try to use it:

Categories Q&A, Unix & Linux Tags mysql, password, stdin Leave a comment
Older posts
Page1 Page2 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress