由买买提看人间百态

topics

全部话题 - 话题: eachline
(共0页)
a9
发帖数: 21638
1
fh = urllib2.urlopen()
fl = fh.readlines()
for eachline in fl:
print eachline
for eachline in fl:
print eachline
这样?
d*******8
发帖数: 3182
2
来自主题: Programming版 - 这个regular expression应该怎么写
Python
file = open(filename, 'r')
allLines = file.readlines()
file.close()
for eachLine in allLines:
if 'fill order' in eachLine:
print eachline
'
matchObj = re.search(r'
l**********n
发帖数: 8443
3
来自主题: Programming版 - python regexp question
how about this:
import re
eachLine = '
http://www.nyse.com/about/listed/lcddata.html?ticker=abt">ABT(.*)<\/a><\/td>', eachLine)
if matchObj:
print matchObj.group(2)
print matchObj.group(1)
w*s
发帖数: 7227
4
so i open this url with
fh = urllib2.urlopen()
for eachline in fh.readlines()
print eachline
.........
now i want to go back to the beginning, and parse the page again.
is there a seek(0) or ?

i did this, not working,
matchObj = re.search(r"", eachLine)

if matchObj:
print matchObj.group(3)
Many thanks !
w*s
发帖数: 7227
5
来自主题: Linux版 - python regexp question (转载)
【 以下文字转载自 Programming 讨论区 】
发信人: wds (中原一点红:心开运就通,运通福就来), 信区: Programming
标 题: python regexp question
发信站: BBS 未名空间站 (Sat Jan 4 19:47:38 2014, 美东)
for a line like this, how to get ABT ?
http://www.nyse.com/about/listed/lcddata.html?ticker=abt">ABT*

i did this, not working,
matchObj = re.search(r"", eachLine)

if matchObj:
print matchObj.group(3)
Many thanks !
w*s
发帖数: 7227
6
来自主题: Programming版 - python regexp question
for a line like this, how to get ABT ?
http://www.nyse.com/about/listed/lcddata.html?ticker=abt">ABT*
(共0页)