0
i am making an app with Tkinter and need to trigger a function using another:
import pynput
import datetime
import tkinter
from tkinter import *
import pyautogui
import time
from pynput.keyboard import Key, Controller
win = Tk()
win.title('autoclass.enter V1')
win.geometry('500x500')
coord1= Entry(win, width=30)
coord1.place(x=178, y=120)
coord2= Entry(win, width=30)
coord2.place(x=178, y=155)
tempo= Entry(win, width=30)
tempo.place(x=178, y=207)
chat1= Entry(win, width=30)
chat1.place(x=178, y=254)
chat2= Entry(win, width=30)
chat2.place(x=178, y=280)
agora= Entry(win, width=30)
agora.place(x=178, y=320)
def chronus():
agora = hora.get()
now = (datetime.datetime.now())
if agora == now:
else:
def start():
time.sleep(2)
b = coord2.get()
c = coord1.get()
d = int(c,0)
e = int(b,0)
f = tempo.get()
g = int(f,0)
h = (g * 60)
i = chat1.get()
j = chat2.get()
k = int(i,0)
l = int(j,0)
pyautogui.click(d, e)
time.sleep(g)
pyautogui.moveTo(k, l, duration = 1)
pyautogui.click(k, l)
keyboard = Controller()
time.sleep(2)
time.sleep(8)
keyboard.type(name.get())
keyboard.press(Key.enter)
keyboard.release(Key.enter)
[...]
the function chronus()
need to trigger the start()
when the time indicated is the same as the time the clock is, but how to make one trigger the other?
Within the
if
of functionchronus()
you perform the function callstart()
. To make this call just typestart()
.– Solkarped