0

After installing the tool onto the computer, if this line is typed, the program will run, " ffuf -c -w /path/of/textfile/as/input -u some_argument " Do help me in finding out how i can use subprocess to make this happen and display the final output provided to me by the program. Thank you!

I have 0 knowledge on subprocess and I'm not able to sort out how i can use it to perform the action. Kindly help. Thank you!

  • 1
    Does this answer your question? [How do I execute a program or call a system command?](https://stackoverflow.com/questions/89228/how-do-i-execute-a-program-or-call-a-system-command) – Marcin Orlowski Dec 23 '22 at 20:57
  • This is a duplicate please refer to the following question to run your command and get the output. https://stackoverflow.com/a/3503909/11993925 – Muneeb Ahmad Khurram Dec 24 '22 at 06:55

1 Answers1

0

Using subprocess module in Python

import subprocess
output = subprocess.check_output("fuf -c -w /path/of/textfile/as/input -u some_argument", shell=True)

Using os

import os
os.popen('fuf -c -w /path/of/textfile/as/input -u some_argument').read()
  • Hi, this is not working. It is giving me an error, n __init__ raise TypeError("bufsize must be an integer") TypeError: bufsize must be an integer – shiva M Dec 24 '22 at 07:40
  • @shivaM Please see https://stackoverflow.com/questions/34156193/subprocess-cp-returns-error-bufsize-must-be-integer – Muneeb Ahmad Khurram Dec 24 '22 at 13:04