2

I want to call an external program from within python, but this external program tries to interact with the user by using an internal script (in the telemarketer sense) to ask questions and change questions based on answers given. The creators of this program are also known for occasionally changing the text of some of these questions, or even worse, the order in which they are asked.

I'm thinking it wouldn't be too hard to write a python module that maps arguments to the wrapper as answers to questions asked by the external program. I could then use difflib, for example, to do some fuzzy matching to try to make the mapping more robust in the event of an order or text change in the external program.

Before doing so I thought I would ask if something like this already exists, as I seem to have a tickling sensation of having seen something similar before, but can't recall the specifics.

Thanks!

5
  • This is very similar to another question that was asked recently Commented May 7, 2011 at 0:13
  • I did do a search, but did not find an answer, Edit: WTF? The linked thread was completely different than my question. I am asking if there is an existing library to interact with command line programs that interrogate the user for parameters rather than taking them directly from the command line. Commented May 7, 2011 at 6:21
  • 1
    @Dhaivat,Sentinel Would you guys care to elaborate on your somewhat cryptic comments? If I interpret them correctly you both come of as complete douchebags. Are you simply making useless comment posts to game stackoverflow? I don't understand why people would go out of their way to post snide, unhelpful comments. Commented May 7, 2011 at 6:32
  • Why, thank you for the complements. I'm going to choose to ignore them since I cannot seem to find my comment. Commented May 7, 2011 at 21:15
  • Yes, both comments have been removed. Thanks for playing. Commented May 10, 2011 at 4:13

1 Answer 1

3

Are you looking for something like pexpect?

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

1 Comment

Yes! thank you! I knew I remember seeing something like this before, but I couldn't remember the correct keywords!

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.