跳板机管理平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
653 B

4 years ago
  1. # -*- coding: UTF-8 -*-
  2. from pick import pick
  3. import sshserver
  4. title = 'Please choose your favorite programming language: '
  5. # options = ['quit', 'Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
  6. options = ['ckqas:192.168.1.44:22', 'ckqas129:192.168.1.129:22']
  7. # option, index = pick(options, title)
  8. # print(option, index)
  9. if __name__ == '__main__':
  10. while True:
  11. option, index = pick(options, title)
  12. if option == "quit":
  13. exit(0)
  14. arr = option.split(":")
  15. if len(arr) == 3:
  16. host = arr[1]
  17. port = int(arr[2])
  18. sshserver.NewTerminal(host, port, "daniel")