from nmb.NetBIOS import NetBIOS
import sys
remote_ip = "192.168.1.10"
srv_name=""
timeout=10 # 10 sec
bios = NetBIOS()
srv_name = bios.queryIPForName(remote_ip, timeout=timeout)
bios.close()
if srv_name is None:
print(remote_ip + " is not found.")
else:
print(srv_name[0] + " is found.")
・pysmbのインストール
pip install pysmb
0 件のコメント:
コメントを投稿