Hi All , I feeled The problem of asynchronous sending is annoying
i means python's data send api send data must wait subfunction run over
like this:
...
def test():
sleep(1)
res=funx()
xxx.send("this is test"+res)
sleep(1)
res=funy()
xxx.send("this is test2"+res)
run result (this is not my hope):
sleep 2 second then xxx.send("this is test"+res) and xxx.send("this is test2"+res) almost at the same time
at windos i tryed import ulrlib.request lib and Solveed this problem
but PRi not supprt this lib (dnpwwo told me) . unfortunately my products run at PRi .
is any good way to Solve this problem?
user code in onconnect function i think is Not beautiful and not good to use
subprocess lib is the only way ?
function sleep problem
Moderator: leecollings
-
- Posts: 5
- Joined: Tuesday 12 June 2018 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9000
- Location: China-Zhejiang
- Contact:
function sleep problem
只要够努力 时间总会给你想要的
-
- Posts: 5
- Joined: Tuesday 12 June 2018 17:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.9000
- Location: China-Zhejiang
- Contact:
Re: function sleep problem
use subprocess.call() Is it the right way to solve the problem?
Look forward to your answer
Look forward to your answer
只要够努力 时间总会给你想要的
Who is online
Users browsing this forum: Bing [Bot] and 1 guest