p.....k
p.....k
#python #programowanie #programista15k #naukaprogramowania

czy python obsługje flushdns? da się ustawić, żeby wywoływało tą funkcję w odstępach czasu?
  • Najlepsze
  • Wszystkie komentarze
M.....o
M.....o
czy python obsługje flushdns?


@ponuryrolnik: Tak, można wywołać flushdns za pomocą python korzystając np z
https://docs.python.org/3/library/os.html#os.system
p.....k
p.....k
@MakuZo: zorbiłem program.

import os
import threading
p.....k
p.....k
@MakuZo:

os.system('cmd /k "ipconfig/flushdns"')
threading.Timer(1.0, os.system('cmd /k "ipconfig/flushdns"')).start() # called every minute

mam coś takiego, ale wyłącza się i nie robi tego co sekundę
arais_siara
M.....o
M.....o
threading.Timer


@ponuryrolnik:

This class represents an action that should be run only after a certain amount of time has passed — a timer. Timer is a subclass of Thread and as such also functions as an example of creating custom threads.


To nie rozwiązuje (całkiem) Twojego problemu
p.....k
p.....k
@MakuZo: dobra zrobione xD