Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- from threading import Thread
- import urllib2
- link = ['http://finance.yahoo.com/q?s=BAC', 'http://finance.yahoo.com/q?s=GE']
- side = []
- line_num = []
- text = ['Powered by BATS Exchange">', 'Powered by BATS Exchange">']
- x = 0
- search_phrase = []
- def func1():
- side[x] = urllib2.urlopen(link[x])
- line_num[x] = 0
- search_phrase[x] = text[x]
- for line in side[x].readlines():
- line_num[x] += 1
- if line.find(search_phrase[x]) >= 0:
- print line_num[x]
- for i in range(2):
- Thread(target = func1).start()
- x = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement