<commit_before><commit_msg>Uploading initial work<commit_after>from ctypes import windll
import Tkinter as tk

parport = windll.inpout32

forw = 0b0001
back = 0b0010
left = 0b0100
righ = 0b1000

def drive(b):
    if b==forw+back: return 'Car can\'t go forwards and backwards simultaneously'
    elif b==left+righ: return 'Car can\'t go left and right simultaneously'
    else:
        parport.Out32(0x378,b)
        return 'Sent signal %d' % b

def key(press):
    if   press.keysym=='Escape': root.destroy()
    if   press.char=='1': drive(back+left)
    elif press.char=='2': drive(back)
    elif press.char=='3': drive(back+righ)
    elif press.char=='4': drive(left)
    elif press.char=='5': drive(0)
    elif press.char=='6': drive(righ)
    elif press.char=='7': drive(forw+left)
    elif press.char=='8': drive(forw)
    elif press.char=='9': drive(forw+righ)
    
        
root = tk.Tk()
print 'Numpad to control the car. ESC to exit.'
root.bind_all('<Key>', key)
root.wm_title('Parport RC')
root.mainloop()
{'fraction_non_alphanumeric': 0.14960629921259844, 'fraction_numerical': 0.03740157480314961, 'mean_word_length': 3.730232558139535, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5035656', 'n_tokens_mistral': 395, 'n_tokens_neox': 363, 'n_words': 97}