开发者

how to use pywhois module in gae

开发者 https://www.devze.com 2023-03-31 18:41 出处:网络
I have problems when try to import pywhois module, i can import my own module but still have troubles when import pywhois. I moved the pywhois folder in my project folder domain, the screentshot is be

I have problems when try to import pywhois module, i can import my own module but still have troubles when import pywhois. I moved the pywhois folder in my project folder domain, the screentshot is below:

how to use pywhois module in gae

This is the import and calling statment below: import part:

from pywhois import *

calling part:

 w = whois('hackbo.com')
 self.response.out.write(w)

The problems is it will always throw a http 500 error, error text is below:

Traceback (most recent call last):
  File "/home/li/Desktop/google_appengine/google/appengine/ext/webapp/__init__.py", line 700, in __call__
    handler.get(*groups)
  File "/home/li/Desktop/google_appengine/domain/main.py", line 43, in get
    w = whois('hackbo.com')
  File "pywhois/__init__.py", line 12, in whois
    text = nic_client.whois_lookup(None, domain, 0)
  File "pywhois/whois.py", line 157, in whois_lookup
    result = self.whois(query_arg, nic开发者_如何转开发host, flags)
  File "pywhois/whois.py", line 100, in whois
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: 'module' object has no attribute 'socket'

What is this error means? why i could import my own module but can not import pywhois?


Google App Engine doesn't support the socket module, which pywhois uses. It allows you to import socket, but it's an empty module.


import whois
site = input ("Enter Site : ")
n = whois.whois (site)
print (n)

this is best whois
Enjoy that, easy.

0

精彩评论

暂无评论...
验证码 换一张
取 消