471,325 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Passing key pressed events to python script

kaarthikeyapreyan
my piece of code needs an key press(enter key) for it to proceed when it is in the middle of a process how can i pass this to my script or how can i capture the key pressed event
Jun 12 '07 #1
2 2707
bartonc
6,596 Expert 4TB
my piece of code needs an key press(enter key) for it to proceed when it is in the middle of a process how can i pass this to my script or how can i capture the key pressed event
Expand|Select|Wrap|Line Numbers
  1. keybordStr = raw_input("Hit 'Enter' to continue")
  2. if keyboardStr == "":  # no keys preceding the enter key
  3.     print "That was the 'enter' key with no other characters"
My IDE won't actually let me test this, but it's pretty basic.
Jun 12 '07 #2
What I really meant was that i have a process that will run for a couple hours which needs a key press(be it any key),for it continue after the first hour,so can i automate it by anyway such that if my process is waiting for more than 5 minutes it should deliver the key press event I have specified in a file
Jan 31 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Dave Smithz | last post: by
2 posts views Thread by DeepBleu | last post: by
5 posts views Thread by Chris Hieronymus | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.