Skip to content
Discussion options

You must be logged in to vote

I don't know the details of your script, but maybe this will help:

import _thread
import time

class test():
     def serverReport(self, id, what):
         print(f'ID: {id[0]}/{id[1]}, CMD: {what['cmd']} {what['val']}')

t = test()
# t.serverReport(('PRG', 123), {'cmd':'add', 'val':(3,4)})

# new_thread(func, (param))
_thread.start_new_thread(t.serverReport, (('PRG', 123), {'cmd':'add', 'val':(3,4)}))

time.sleep(5) # wait a bit
print('Done!')

This will give:

ID: PRG/123, CMD: add (3, 4)
Done!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@namgang
Comment options

@namgang
Comment options

Answer selected by namgang
Comment options

You must be logged in to vote
1 reply
@namgang
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
3 participants