I’m trying to get the behaviour of typical IM clients that use Return to send a text and Shift + Return to insert a linebreak. Is there a way to achieve that with minimal effort in Python, using e.g. readline and raw_input?
I’m trying to get the behaviour of typical IM clients that use Return to
Share
Ok, I heard it can be accomplished also with the
readline, in a way.You can
import readlineand set in configuration your desired key (Shift+Enter) to a macro that put some special char to the end of the line and newline. Then you can callraw_inputin a loop.Like this: