Python Forum
redirect STDIO in the Python code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
redirect STDIO in the Python code
#1
i need to have the ability to do standard I/O redirection within a CLI script in Python. I've done this a few times in C. to do this in Python i could just follow the way in C using os.open(), os.dup2(), and os.close(). but that might not let Python know what is going on, if it needs to know. is there a good Pythonic way to do this?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
redirect STDIO in the Python code - by Skaperen - Jun-23-2023, 01:32 AM
RE: redirect STDIO in the Python code - by Skaperen - Jun-27-2023, 11:12 PM
RE: redirect STDIO in the Python code - by Skaperen - Jul-01-2023, 12:48 AM
RE: redirect STDIO in the Python code - by Skaperen - Jul-05-2023, 12:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  stderr redirect to file fmr300 2 3,652 Apr-03-2021, 01:31 AM
Last Post: fmr300
  Cannot redirect print to a file tester_V 3 2,553 Sep-11-2020, 12:21 AM
Last Post: tester_V
  redirect url_for passing arguments with the url Leon79 1 1,685 Jul-09-2020, 05:20 PM
Last Post: Leon79
  Redirect to __stdout__ fails in IDLE shell Pavel_47 1 1,986 Apr-13-2020, 05:13 PM
Last Post: deanhystad
  Redirect to file vndywarhol 1 2,326 Aug-23-2018, 11:01 AM
Last Post: DeaD_EyE
  Python redirect users to another url after form post blsturgeon 5 18,980 Jun-28-2018, 11:53 PM
Last Post: gontajones
  Script for media content and redirect in to a file puneet102 0 2,371 May-22-2018, 12:06 PM
Last Post: puneet102

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020