本文整理汇总了Python中Person.Person.load_from_file方法的典型用法代码示例。如果您正苦于以下问题:Python Person.load_from_file方法的具体用法?Python Person.load_from_file怎么用?Python Person.load_from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person.Person
的用法示例。
在下文中一共展示了Person.load_from_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clear_screen
# 需要导入模块: from Person import Person [as 别名]
# 或者: from Person.Person import load_from_file [as 别名]
from Person import Person
from ChairStructure import ChairStructure, Chair
from Exceptions import SelectionError
from Sort import Sort
from BinarySearchTree import BinarySearchTree
# prints new line 30 times to clear the console view
def clear_screen():
print('\n' * 30)
# builds a new structure with the people from save file
people = Person.load_from_file()
my_structure = ChairStructure.build_from_list_of_people(people)
running = True
def remove_person():
# asks user to select which trait to sort by
print('\nWhich of the following traits would you like to search?\n')
print("1.ID\n"
"2.Name\n"
"3.Age\n"
"4.Personality Rating")
print('\n')
selection = input('Choice: ')
# checks to make sure selection is valid option
while True: