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
  Help with to check an Input list data with a data read from an external source sacharyya 3 317 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  output provide the filename along with the input file processed. arjunaram 1 903 Apr-13-2023, 08:15 PM
Last Post: menator01
  serial input/output barryjo 3 2,374 Dec-27-2021, 11:57 PM
Last Post: barryjo
  How to input & output parameters from command line argument shantanu97 1 2,506 Apr-13-2021, 02:12 PM
Last Post: Larz60+
  Code giving same output no matter the input. Yort 2 2,465 Dec-20-2020, 05:59 AM
Last Post: buran
  Handling multi-input/output audio in python bor1904 4 3,495 Nov-04-2020, 08:25 AM
Last Post: CHLOVRL
  single input infinite output problem Chase91 2 1,906 Sep-23-2020, 10:01 PM
Last Post: Chase91
  waiting for barcode scanner output, while main program continues to run lightframe109 3 4,581 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE
  How to get program output from subprocess.Popen? glestwid 1 2,333 Aug-19-2020, 05:44 AM
Last Post: buran
  how can we record a video file from our program output (moving object) Zhaleh 0 1,779 Aug-03-2020, 02:47 PM
Last Post: Zhaleh

Forum Jump:

User Panel Messages

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