适用于 Windows 的 python whois [英] python whois for windows
问题描述
我尝试在 python 中获取 whois.我用这个http://code.google.com/p/pywhois/但它只能在 linux 中运行.是否可以在 Windows 上运行它?目前我收到错误(因为使用了内部 linux 命令 whois)
I try to get whois in python. I use this http://code.google.com/p/pywhois/ but it run only in linux. Is it posible to run it on windows? currently i get errors (because internal linux command whois used)
推荐答案
在 Windows 上就像在 Linux 上一样,如果 whois
程序没有安装,pywhois 会报错.例如,您可以尝试this whois.
On Windows just like on Linux, pywhois gives an error if the whois
program is not installed. You could try this whois, for example.
原因当然是在pywhois/init.py,第 11 行:
The reason, of course, is in pywhois/init.py, line 11:
r = subprocess.Popen(['whois', domain], stdout=subprocess.PIPE)
显然这一行需要运行一些现有的、安装的 whois
命令行程序(它接受域作为命令行参数进行查找),无论它运行在什么操作系统上.
Clearly this line needs to run some existing, installed whois
command-line program (which accepts the domain to look up as a commandline argument), whatever OS it's running on.
这篇关于适用于 Windows 的 python whois的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!