SORU
25 Kasım 2008, Salı


Python ile bir siteye Ping?

Temel kod:

from Tkinter import *
import os,sys

ana= Tk()
def ping1():
    os.system('ping')

a=Button(pen)
ip=("192.168.0.1")

a.config(text="PING",bg="white",fg="blue")
a=ping1.ip ??? 
a.pack()

ana.mainloop()

Nasıl siteler veya bir adresi ping olabilir miyim?

CEVAP
25 Kasım 2008, Salı


Bu Matthew Dixon Cowles pure Python ping Jens Diemer bkz. Ayrıca, Python root linux (yani ping) ICMP yuva spawn gerektirdiğini unutmayın.

import ping, socket
try:
    ping.verbose_ping('www.google.com', count=3)
    delay = ping.Ping('www.wikipedia.org', timeout=2000).do()
except socket.error, e:
    print "Ping Error:", e

Kolay okunur kendisi, ilham için Ping.do verbose_ping ve uygulamaları görmek.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • BenjiManTV

    BenjiManTV

    20 Mart 2011
  • CMTelly

    CMTelly

    2 Mayıs 2007
  • inovationgmbh

    inovationgmb

    28 EYLÜL 2010