[[python_wiki:test_port]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python_wiki:test_port [2015/03/10 03:27]
billdozor
python_wiki:test_port [2019/05/26 03:50] (current)
Line 10: Line 10:
 ---- ----
  
-===== The Code =====+====== Usage ====== 
 + 
 +Call this function, checking server1 for tcp/22 (ssh): 
 +<code python>​ 
 +if test_port(server1,​22):​ 
 +  do ssh stuff 
 +else: 
 +  print("​Server not listening on tcp/​22!"​) 
 +</​code>​ 
 + 
 +---- 
 + 
 +====== The Code =====
 <code python> <code python>
 import socket import socket
Line 27: Line 40:
 </​code>​ </​code>​
  
-==== Usage ==== +---- 
-Call this function, checking server1 for tcp/22 (ssh): +
-<code python>​ +
-if test_port(server1,​22):​ +
-  do ssh stuff +
-else: +
-  print("​Server not listening on tcp/​22!"​) +
-</​code>​+
  • python_wiki/test_port.txt
  • Last modified: 2019/05/26 03:50
  • (external edit)