No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to write a program that needs to detect key presses, which I've already done using this code I found online: TERMIOS = termios def getkey(): fd = sys.stdin.fileno() old = termios.tcgetattr(fd) new = termios.tcgetattr(fd) new[3] = new[3] & ~TERMIOS.ICANON & ~TERMIOS.ECHO new[6][TERMIOS.VMIN] = 1 new[6][TERMIOS.VTIME] = 0 termios.tcsetattr(fd, … |
|
I've been trying to find information on this for a while, but I can't seem to find anything. I want to use python to send a command to the command prompt, then instead of sending the output to the console window, put the output into a variable that I can … |
|
I was wondering if anyone knew of a way to scan for key presses in Python. It doesn't need to detect WHAT key is being pressed, just that one is being pressed. Also it needs to work with the console. |
|
I'm trying to make a simple email sender used for submitting problem reports on a program I am writing. The sender doesn't need to have changeable sender and receiver address, the address the program will use for sending the email will be the same always (for this example, 'example@example.com') and … |
|
I was wondering how to make a sound play repeatedly in python. I'm making a simple alarm clock program, and at a certain time (6:30 for example) it will play a recorded sound over and over again until the user presses enter. I think I have that figured out, but … |
|
Is there a way in python to look through a file line by line and find a word in that line, but only if the word is the first word in the line? Like if it was looking for the word "apple" then it would only notice if the line … |