import os
import sys
import time

import myconfig

b = ['123']
a = os.path.abspath(myconfig.__file__)
print(a)
b[-1]=os.path.getmtime(a)
print(b)
while True:

    a = os.path.abspath(myconfig.__file__)
    mtime = os.path.getmtime(a)

    if mtime != b[-1]:
        del sys.modules['myconfig']
        import myconfig
        b[-1]=mtime
        print(b)
    print(myconfig.ip)
    time.sleep(2)

相关文章:

  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-05-26
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-01-22
  • 2021-07-19
  • 2021-05-07
相关资源
相似解决方案