Mercurial > repos > bernhardlutz > rest_tool
view readfile.py @ 7:35b41070c20d draft
Deleted selected files
| author | bernhardlutz |
|---|---|
| date | Thu, 03 Apr 2014 06:51:54 -0400 |
| parents | 54358dfa62c0 |
| children | 3c1e862e8cd6 |
line wrap: on
line source
#!/usr/bin/env python import io import urllib2, urllib, httplib def getListFromFile(file): idlist=[] for line in file: if int(line): idlist.append(line.strip()) return idlist def getresult(url): try: connection = urllib2.urlopen(url) except urllib2.HTTPError, e: return "" else: return connection.read().rstrip()
