0

I am looking for a way to have a user input entered between two strings. Is there an easy way to do this?

For example;

input("text blah blah" The users input appears here " more text is here")

so when the program is running it would look like this;

text blah blah more text here

and the user can input the text between 'blah' and 'more'.

2
  • it would imply some kind of control over the terminal, which you can't achieve using simply input. Commented Jan 3, 2014 at 22:50
  • 4
    You might be interested in the curses module if you want to build complicated interfaces. This SO question might be relevant. Commented Jan 3, 2014 at 22:50

1 Answer 1

0

You can try this but you need to use the input first.

print(f"text blah blah {input()} more text is here")
Sign up to request clarification or add additional context in comments.

1 Comment

if you run the code it will have you input something the add what you inputed in the f string.

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.