Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. async def run_client(host, command):
  2.     try:
  3.         with (yield from asyncio.wait_for(asyncssh.connect('localhost'), timeout = 3)) as conn:
  4.             return await conn.run(command)
  5.     except TimeoutError:
  6.         # handle connection timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement