1234567891011121314151617181920212223242526272829303132 |
- ## coding:utf-8
- from a2s.a2s_client import a2s_execute
- import time
- def start_file2txt(data: list):
- # 本次不使用SSL,所以channel是不安全的
- try:
- for t in range(5):
- result = a2s_execute("192.168.3.240:9090", "test2txt", 240, b"test")
- result = result.decode("utf-8")
- return result
- except Exception as e:
- print(e)
- return ""
- def start_test2img(data: list):
- # 本次不使用SSL,所以channel是不安全的
- try:
- for t in range(5):
- result = a2s_execute("192.168.3.240:9090", "test2img", 60, b"test")
- result = result.decode("utf-8")
- return result
- except Exception as e:
- print("test2img异常::",e)
- return ""
- if __name__ == '__main__':
- start_time=time.time()
- result=start_file2txt([])
- # result=start_test2img([])
- print(result)
- print(time.time()-start_time)
|