本文整理汇总了Python中problem.Problem.submitted方法的典型用法代码示例。如果您正苦于以下问题:Python Problem.submitted方法的具体用法?Python Problem.submitted怎么用?Python Problem.submitted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类problem.Problem
的用法示例。
在下文中一共展示了Problem.submitted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _parseProblem
# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import submitted [as 别名]
def _parseProblem(self, data):
problem = Problem()
problem.id = data[0]
problem.title = data[1]
problem.accepted = data[2]
problem.submitted = data[3]
problem.ratio = data[4]
problem.source = data[5]
return problem
示例2: parseProblems
# 需要导入模块: from problem import Problem [as 别名]
# 或者: from problem.Problem import submitted [as 别名]
def parseProblems(volume):
url = "http://%s/toj/list%d.html" % (TOJ_HOST, volume)
html = _readURL(url)
lines = html.split('\n')
problems = list()
for line_pos in xrange(28, len(lines)):
token = lines[line_pos]
if token.find("p") != 0:
break
problem = Problem()
token2 = token[ : : -1]
endRatio = token2.find('"')
startRatio = token2.find('"', endRatio+1)
endTitle = token2.find('"', startRatio+1)
startTitle = token.find('"')
endTitle = len(token) - endTitle - 1
endRatio = len(token) - endRatio - 1
startRatio = len(token) - startRatio - 1
problem.title = token[startTitle+1:endTitle].replace("\\", "")
ratio = token[startRatio+1:endRatio]
try:
problem.ratio = float(ratio) / 100.0
except:
None
token = token[0:startTitle] + token[endTitle+1:startRatio] + token[endRatio+1:len(token)-1]
params = token.split(",")
problem.id = int(params[2])
problem.accepted = int(params[5])
problem.submitted = int(params[6])
problems.append(problem)
return problems