我们如何使用 Python 中的 ntplib 库运行本地 ntp 服务器

问题描述

有人可以帮助我了解 Python 中的本地 NTP 服务器。 python代码如下:

import ntplib
from time import ctime
while True:
 try:
  c = ntplib.NTPClient()
  response = c.request(host='192.168...',port=2947)
  print(response)
  print(ctime(response.tx_time))
 except Exception as e:
    print(e)

当我运行此代码时,输​​出未返回从 192.168 收到的响应....

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)