代码之家  ›  专栏  ›  技术社区  ›  Evg

用于Windows的python whois

  •  1
  • Evg  · 技术社区  · 16 年前

    我试着在巨蟒中找到谁。我用这个 http://code.google.com/p/pywhois/ 但它只在Linux中运行。是否可以在Windows上运行它?目前我得到错误(因为使用的是内部Linux命令)

    3 回复  |  直到 7 年前
        1
  •  5
  •   Alex Martelli    16 年前

    在Windows上,就像在Linux上一样,pywhois会给出一个错误,如果 whois 未安装程序。你可以试试 this whois 例如。

    当然,原因是 pywhois/ init .py ,第11行:

    r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)
    

    显然,这条线路需要运行一些现有的、已安装的 呼啸声 命令行程序(它接受域作为命令行参数进行查找),不管它运行的是什么操作系统。

        2
  •  1
  •   Guillaume Lebourgeois    16 年前

    你可以使用:

    os.system("whois %s" % hostname)
    

    或使用 urllib 连接 http://www.whois.net 和废料含量。

        3
  •  0
  •   Matheus Lacerda Fidan Bacaj    7 年前
    import whois
    
    site = input ("Enter Site : ")
    
    n = whois.whois (site)
    
    print (n)
    # whois python
    # or  with CMD  enjoy that