惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
F
Full Disclosure
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recorded Future
Recorded Future
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
T
Threatpost
P
Privacy International News Feed
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
I
Intezer
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy & Cybersecurity Law Blog
A
Arctic Wolf
博客园 - 聂微东
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
H
Help Net Security
S
Schneier on Security
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
月光博客
月光博客
NISL@THU
NISL@THU
A
About on SuperTechFans
Spread Privacy
Spread Privacy
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
G
Google Developers Blog
W
WeLiveSecurity
P
Palo Alto Networks Blog
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
博客园 - 司徒正美
L
LINUX DO - 热门话题
小众软件
小众软件

博客园 - myx

安装gitlab管理自己的代码 升级Tornado到4后weibo oauth登录不了 SQL Server 无日志文件附加数据库 用monit监控系统关键进程 Failed to read auto-increment value from storage engine错误的处理方法 今天测试了一下 sqlalchemy 性能 PIL The _imaging C module is not installed phpExcel大数据量情况下内存溢出解决 tcpdf慢及常用的一些方法及问题 CodeIgniter出现Disallowed Key Characters的问题 CodeIgniter链接ms sql 如果数据库名称有点号连接出错 用python写windows服务 CodeIgniter链接ms sql 的过程windows 2008 关于NTLM认证的.NET,php,python登录 DotNetOpenAuth的Facebook登录,获取头像与基本资料 php里的html内容切取 js生成新加坡的NRIC号码 Sina站内应用的登录 PowerDesigner 链接MySql 用ODBC链接不上的问题
Python获取WebService
myx · 2013-04-26 · via 博客园 - myx
# coding=utf-8
from suds.client import Client
from suds.xsd.doctor import ImportDoctor, Import
from pprint import pprint
# import sys
# default_encoding = 'utf-8'
# if sys.getdefaultencoding() != default_encoding:
#    reload(sys)
#    sys.setdefaultencoding(default_encoding)

url ='http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl'
imp = Import('http://www.w3.org/2001/XMLSchema')    # the schema to import.
imp.filter.add('http://WebXml.com.cn/')  # the schema to import into.
d = ImportDoctor(imp)
client = Client(url, doctor=d)
nms=u"广东"
result = client.service.getSupportCity(nms)
print nms
mylogfile = 'log.txt'
f = open(mylogfile, 'a')
f.write('i am logging! timber!....\n')
#f.write(result)

pprint (result[0][0])
for rt in result[0]:
    print rt
    f.write(rt)
f.close()