5 years ago

Oof, I have just now added pip to my program, though now it is giving me another error that says unindent does not match any outer indentation level. The program is python 3.8.6, though here is the code.


from pynput import keyboard

import os

import tkinter as tk

root= tk.Tk()

canvas1 = tk.Canvas(root, width = 300, height = 300, bg = 'gray90', relief = 'raised')

canvas1.pack()

def myCmd ():

os.system('cmd /k "color c"')

button1 = tk.Button(text=' press Ctrl and L ', command=myCmd, bg='green', fg='purple', font=('helvetica', 12, 'bold'))

canvas1.create_window(150, 150, window=button1)

root.mainloop()

COMBINATIONS = [

{keyboard.Key.ctrl, keyboard.KeyCode(char-'l')},

{keyboard.Key.ctrl, keyboard.KeyCode(char-'L')}

]

current = set()

def on_press(key):

if any([key in COMBO for COMBO in COMBINATIONS]):

current.add(key)

if any(all(k in current for k in COMBO) for COMBO in COMBINATIONS): execute()

def on_release(key):

if any([key in COMBO for COMBO in COMBINATIONS]):

current.remove(key)

def execute ():

('cmd /k "color c & date')

with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:

listener.join()



0 comments

Loading...

Next up

Did they add this for pride month or has this always been there?

20th crown win of the season!

Considering I only played like maybe 2 hrs I did really good

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

Cactus Farm is fully complete and functional (8x4x2 or 64 cactus plants), and the sugar cane farm is a wip (I will randomly post updates about my minecraft world here) [1]

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

Sdsifesjfejfioejfeifjrioferj eirjwriot ewjeioawjeaeior esfio jfsfdskjf dsf kjdslfdskj fjlf daj pa pjaw ijewrioewjrioewj rewr iaewj reriot jtrs yiodrj tdrio jer ipersjuteriv ruqwjpeo jwepoawjaspdo jdfgio jdfgoidfjgfiohjdrgtioerj ioerj ersi tarw jutarwio!

Accidentally won a solo game while unlocking Blazing Fire Cerberus!

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

Remember when there'd be random ahh images like these that everyone reposted? (not that it's bad tho, I just kinda forgot that these types of images existed)