Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
datetime issue
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Steven D'Aprano, post: 5060000"] This only works if you are running a Linux or Unix shell with the libreadline library installed. This should work on nearly any modern Linux system with the bash shell. I don't know about other shells. On Mac OS, the relevant library is called libedit instead, and the details may be different. On Windows, you're out of luck. Anyway, using Linux and bash: at the shell, if I type Ctrl-U, that is interpreted by the shell to mean "clear the line currently being edited". So if I type Ctrl-U, the line is cleared. But if I type Ctrl-Q first, then Ctrl-U, instead readline enters a literal ^U character (ASCII value 0x15 = NAK Negative AcKnowledgment) into the line editing buffer. The same trick should work in the Python interactive editor: 21 Note that this may or may not work in IDEs such as IDLE. Many IDEs do their own thing for editing, and there's no guarantee they will support this functionality. One last comment: readline is very configurable, and the command to insert the next character could be just about anything. But Ctrl-Q is the standard. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
datetime issue
Top