1

I am trying to automate a task on a file using Python pwntools.

However, no matter what I do I am unable to get the output.

Based on the behavior of the program (for example: that it takes up the entire terminal window, among other things) I believe that it is displayed using the dialog command.

I have tried many things, but nothing seems to capture the data.

Even if I try script output.txt and run either the file or, for example, dialog --yesno "\nBla bla bla...\n\nDo you accept?" 10 30 the output just isn't captured.

I would also like to capture the data while the program is running, I do not want to close it.

Thanks!

1 Answer 1

1
import sys
sys.stdout=open("test.txt","w")
print ("hello")
sys.stdout.close()

Now the hello will be written to the test.txt file. Make sure to close the stdout with a close, without it the content will not be save in the file

Sign up to request clarification or add additional context in comments.

1 Comment

This does not answer the question described. All your code does is redirect the stdout to a file. I am trying to figure out how to get stdout working in the first place

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.