Python Forum
input-external program-output
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
input-external program-output
#1
Hi All,
How can I call an external program in python, feed .txt file and retrieve the output.
Thanks!
Reply
#2
Could you please elaborate, this is not a very detailed description of what you'd like to do
Reply
#3
1) subprocess module
2)
with open("somefile.txt") as fin:
    for line in fin:
        print(line.swapcase())
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  interactive process for input and output maiya 1 500 Mar-27-2025, 08:40 AM
Last Post: Gribouillis
Question [SOLVED] Same input different output antarling 2 850 Oct-25-2024, 11:28 PM
Last Post: antarling
  Help with to check an Input list data with a data read from an external source sacharyya 3 1,630 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  output provide the filename along with the input file processed. arjunaram 1 1,490 Apr-13-2023, 08:15 PM
Last Post: menator01
  serial input/output barryjo 3 4,947 Dec-27-2021, 11:57 PM
Last Post: barryjo
  How to input & output parameters from command line argument shantanu97 1 3,553 Apr-13-2021, 02:12 PM
Last Post: Larz60+
  Code giving same output no matter the input. Yort 2 4,631 Dec-20-2020, 05:59 AM
Last Post: buran
  Handling multi-input/output audio in python bor1904 4 4,806 Nov-04-2020, 08:25 AM
Last Post: CHLOVRL
  single input infinite output problem Chase91 2 2,655 Sep-23-2020, 10:01 PM
Last Post: Chase91
  waiting for barcode scanner output, while main program continues to run lightframe109 3 6,253 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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