from base_config.config import OpenSMB, SMB
import os, time, calendar, requests, decimal, platform, fs.smbfs
info_dict = SMB.EPDI_dict
info_dict['host'] = ('FS03','10.6.12.182')
info_dict['direct_tcp'] = True
# smb = OpenSMB(info_dict)
print('ok')
# 根据 ip 查询电脑名
import nmb.NetBIOS
nb = nmb.NetBIOS.NetBIOS()
response = nb.queryIPForName("10.167.51.166")  # with you IP here obviously
print(response)
 

import fs.smbfs
my_fs = fs.smbfs.SMBFS(("<HOSTNAME>", "<IP>"), ...)
 
参考
 https://github.com/althonos/fs.smbfs/issues/2




![[C++]C++工具之对异常情况的处理(throw、catch、try)以及用命名空间避免同名冲突](https://i-blog.csdnimg.cn/direct/b7960c80d26049f181852b9483e10048.png)














