Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

break input loop

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!"
Comment

PREVIOUS NEXT
Code Example
Python :: dictionary multiple values per key 
Python :: python find closest date 
Python :: how to sum all the values in a list in python 
Python :: python - merge and incluse only specific columns 
Python :: for loop python 
Python :: add legend to colorbar 
Python :: pandas excel writer append in row 
Python :: Tree Traversals inorder,preorder and postorder 
Python :: how to len in the pythin 
Python :: como instalar python en ubuntu 20.04 
Python :: programação funcional python - lambda 
Python :: How to check the number of occurence of each character of a given string in python 
Python :: sort list in python 
Python :: How to clone or copy a list in python 
Python :: python math packege power e 
Python :: loading bar 
Python :: join function in python 
Python :: python print in the same line 
Python :: python modulo 
Python :: loop for python 
Python :: access list index python 
Python :: pairs with specific difference 
Python :: simple bmi calculator using python 
Python :: Python NumPy delete Function Example 
Python :: add all elements of list to set python 
Python :: python loop until condition met 
Python :: add items to list python 
Python :: python string does not contain 
Python :: python 2d matrix declare 
Python :: get min of list python 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =