本文整理汇总了Python中User.sats方法的典型用法代码示例。如果您正苦于以下问题:Python User.sats方法的具体用法?Python User.sats怎么用?Python User.sats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User.sats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: populate_database
# 需要导入模块: import User [as 别名]
# 或者: from User import sats [as 别名]
def populate_database():
"""
Returns a list of College objects to be stored in the database
Then they can be reconstructed by called
colleges = db_load_colleges()
"""
database_schools = []
n = 0
cols = []
cols_with_size = get_sizes()
while n < len(colleges_with_sat):
c = C(colleges_with_sat[n], colleges_with_sat[n+1], colleges_with_sat[n+2], colleges_with_sat[n+3], colleges_with_sat[n+4])
cols.append(c)
n+=5
for i in range(0, len(colleges)):
name = colleges[i]
if False: #db_college_exists(name):
continue
sats = {}
size = 0
tuition = 0
address = ""
zipcode = 0
matched = False
for c in cols:
if levenshtein(c.name, name) < 3:
matched = True
sats['math'] = c.math_range
sats['reading'] = c.read_range
if not matched:
sats = None
for c in cols_with_size:
#print c[0]
if levenshtein(c[0], name) < 3:
size = c[1]
tuition = c[2]
address = c[3]
zipcode = c[4]
#print c
break
college = College(name, "", i, sats, size, tuition, address, zipcode)
#print college
database_schools.append(college)
#college.print_college()
user = User()
user.name = "Aaron"
user.sats = {"math" : 800, "reading" : 800}
#print college.find_location()
#print college.get_difficulty()
return database_schools