Re: [问题] iperf3 for python在windows上的使用

楼主: Neisseria (Neisseria)   2017-09-05 23:11:29
小弟节录了 IPerf3 物件的程式码如下:
class IPerf3(object):
"""The base class used by both the iperf3 :class:`Server` and :class:`Client`
.. note:: You should not use this class directly
"""
def __init__(self,
role,
verbose=True,
lib_name='libiperf.so.0'):
"""Initialise the iperf shared library
:param role: 'c' = client; 's' = server
:param verbose: enable verbose output
:param lib_name: The libiperf name providing the API to iperf3
"""
# TODO use find_library to find the best library
try:
self.lib = cdll.LoadLibrary(lib_name)
except OSError:
raise OSError('Could not find shared library {0}. Is iperf3 installed?'.format(lib_name))
# More code...
看起来你需要传入 lib_name 参数
Windows 我比较少用,应该是传 .dll 吧,.so 是 GNU/Linux 在用的
Python 套件应该都可以看原始码
有时候还是要看一下,比较能够除错
※ 引述《jack622 (High)》之铭言:
: Python官网有提供iperf3的lib
: 小弟我抓下来使用后发现第一关就卡住了
: import iperf3 (这步没有问题)
: client = iperf3.Client() 这步就出问题了
: 他显示OSError:Could not find share library libiperf.so.0. Is iperf3 installed?
: 但是windows版的iperf是不用安装的
: 只要下载档案,然后用CMD指到该资料夹就可以开始用command line操作他
: 只有linux版的iperf需要安装
: 请问各位大大有相关解法吗?
:
作者: jack622 (High)   2017-09-06 11:26:00
我入门不久无法尽懂,不过会好好研究的,感谢你特地回我意思是这个lib.so.0本来就不是for windows的,然后我要找个dll的版本或是尝试修改他的套件吗?

Links booklink

Contact Us: admin [ a t ] ucptt.com