最近有个需求,要检测配置中的那些url的域名是否都正常,即是否都能ping通。 不过配置中url格式是这样的 http://www.something.com:1234/ 。 要ping的是www.something.com。 要把url中的域名抽离出来,一般会想到的是切割字符串,或者用正则表达式。 不过有个更干净利落的方法,就是python标准库自带的urlparse。url的各个部分都可以用这个东东抽离出来。 >> url = 'http://www.something.com:1234/foo/index.html?name=kzc&age=29#second Read More
posted @ 2013-07-23 18:29
javawebsoa
Views(213)
Comments(0)
Diggs(0)
Greg and Graphtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGreg has a weighed directed graph, consisting ofnvertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph an Read More
posted @ 2013-07-23 18:27
javawebsoa
Views(327)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号