Python: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

7 April 2024

  • curprev 18:4918:49, 7 April 2024Mark talk contribs 835 bytes 0 →‎Check for input #1 undo
  • curprev 18:4818:48, 7 April 2024Mark talk contribs 835 bytes +835 Created page with "=== Check for input #1 === <code> import sys, select print "You have ten seconds to answer!" i, o, e = select.select( [sys.stdin], [], [], 10 ) if (i): print "You said", sys.stdin.readline().strip() else: print "You said nothing!" </code> === Check for input #2 === <code> import signal TIMEOUT = 5 # number of seconds your want for timeout def interrupted(signum, frame): "called when read times out" print 'interrupted!' signal.signal(sig..." Tag: Visual edit: Switched