# import paramiko as paramiko
# import time
# ssh = paramiko.SSHClient()
# ssh.load_system_host_keys()
# ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
# ssh.connect(hostname='xxx.xxx.xxx.xxx', port=22, username='hamzsy', password='123456',compress=True)
# # stdin, stdout, stderr = ssh.exec_command('bash --login -c "appium"')
# stdin, stdout, stderr = ssh.exec_command('lsof -i:4723')
# # time.sleep(3)
# # stdin, stdout, stderr = ssh.exec_command('pwd')
# # ssh.exec_command('kill -9 4091')
# print(stdout.read().decode().split(' ')[12].split(' ')[0])
# # ssh.exec_command('kill -9 3874')
# # print(stdout.read().decode())
#
# ssh.close()
from threading import Thread
from time import sleep
def asynca(f):
def wrapper(*args, **kwargs):
thr = Thread(target=f, args=args, kwargs=kwargs)
thr.start()
return wrapper
@asynca
def A():
sleep(5)
print("a function")
def B():
print("b function")
A()
B()