Justaus3r
Justaus3r

Reputation: 423

Is it Possible to get user input(multiline message)without a newline

I am taking user input and my message is a multi line string,so whenever i execute my script, a newline is printed.

code:

name = "name"
message_count = "count"
curr_time = "curr_time"
input_message = f"""
╔=======-{name}|{message_count}|{curr_time}
|_____
"""    
var = input(input_message)

Output:

Image

i want the cursor to be on same line as the input message,is it possible in python.

Upvotes: 1

Views: 41

Answers (1)

Unmitigated
Unmitigated

Reputation: 89214

Just remove the newline at the end of the string.

input_message = f"""
╔=======-{name}|{message_count}|{curr_time}
|_____"""   

Upvotes: 1

Related Questions