Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Hege1234

    addikt

    válasz justmemory #3858 üzenetére

    threading-et még nem használtam
    az itt lévő utolsó minta alapján próbálkoztam, de így is csak akkor fut tovább, ha eltűnt a notif
    (persze az is benne van, hogy nem is jól értettem meg a threading használatát :B )

    import threading
    import os

    def task1():
    print("Task 1 assigned to thread: {}".format(threading.current_thread().name))
    print("ID of process running task 1: {}".format(os.getpid()))

    def task2():
    import PySimpleGUI as sg

    menu02a = 'HandBrakeCLI'
    output = 'testfile.mkv'

    tray = sg.SystemTray()
    tray.notify(menu02a, output+'\n re-encode kész!', fade_in_duration=200, display_duration_in_ms=3000, alpha=2)

    if __name__ == "__main__":
    # creating threads
    t1 = threading.Thread(target=task1, name='t1')
    t2 = threading.Thread(target=task2, name='t2')

    # starting threads
    t1.start()
    t2.start()

    # wait until all threads finish
    t1.join()
    t2.join()


    print('encode kész\n felugró notif közbe látszódik ez is')

    next = input('\n és ez is')

Új hozzászólás Aktív témák