New stuff: xmlrpclib
#get the connection:
>>> from xmlrpclib import ServerProxy
>>> s=ServerProxy('http://www.pythonchallenge.com/pc/phonebook.php')
>>> s.system.listMethods()
['phone', 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall', 'system.getCapabilities']
an image 'evil4.jpg' from the previous challenge shows that the evil is 'Bert'
So,
>>> s.phone('Bert')
'555-ITALY'
the answer is 'italy.html'
#get the connection:
>>> from xmlrpclib import ServerProxy
>>> s=ServerProxy('http://www.pythonchallenge.com/pc/phonebook.php')
>>> s.system.listMethods()
['phone', 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall', 'system.getCapabilities']
an image 'evil4.jpg' from the previous challenge shows that the evil is 'Bert'
So,
>>> s.phone('Bert')
'555-ITALY'
the answer is 'italy.html'
通过使用 Python 的 xmlrpclib 模块与远程服务器交互,获取并解析特定信息,完成了一个有趣的编程挑战。从图片线索中得知目标人物为 'Bert',通过调用远程服务查询得到电话号码 '555-ITALY',最终答案指向 'italy.html'。
1417

被折叠的 条评论
为什么被折叠?



