About 982,000 results
Open links in new tab
  1. 7. Input and OutputPython 3.14.3 documentation

    1 day ago · 7. Input and Output ¶ There are several ways to present the output of a program; data can be printed in a human-readable form, or written to a file for future use. This chapter will discuss some …

  2. python - Running shell command and capturing the output - Stack Overflow

    The check_output function works in all officially maintained versions of Python. But for more recent versions, a more flexible approach is available. Modern versions of Python (3.5 or higher): run If …

  3. Ways To Save Python Terminal Output To A Text File

    Jul 23, 2025 · In Python, saving terminal output to a text file is a common need when you want to keep a record of what your program prints. Whether you're debugging code, logging results or simply …

  4. Input and Output in Python - GeeksforGeeks

    Mar 25, 2026 · The print () function is used for output in various formats and the input () function enables interaction with users. Taking Input using input () Python's input () function is used to take user input. …

  5. Store Functions in List and Call in Python - GeeksforGeeks

    Jul 23, 2025 · Using List Comprehension to Call Functions We can use list comprehension to call functions stored in a list and store their results in a new list. This method makes the code more …

  6. Save Shell Command Output to Variable in Python: Complete Guide

    Nov 19, 2024 · Learn different methods to capture and store shell command output in Python variables using subprocess, os.popen, and commands modules with practical examples.

  7. python - How to get the return value from a thread? - Stack Overflow

    Mar 18, 2023 · In Python 3.2+, stdlib concurrent.futures module provides a higher level API to threading, including passing return values or exceptions from a worker thread back to the main thread. You can …

  8. How to put Python loop output in a list - Stack Overflow

    Sep 5, 2016 · How can I use `return` to get back multiple values from a loop? Can I put them in a list? (2 answers) What is the purpose of the return statement? How is it different from printing? (15 answers) …

  9. Basic Input and Output in Python

    In Python, the input() function allows you to capture user input from the keyboard, while you can use the print() function to display output to the console. These built-in functions allow for basic user …

  10. How to Save Console Output to Variable in Python - PyTutorial

    Nov 19, 2024 · Learn efficient methods to capture and store console output in Python variables using io.StringIO, contextlib.redirect_stdout, and subprocess. Includes practical examples and best practices.