本文整理汇总了Python中student.Student.create_by_csv方法的典型用法代码示例。如果您正苦于以下问题:Python Student.create_by_csv方法的具体用法?Python Student.create_by_csv怎么用?Python Student.create_by_csv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类student.Student
的用法示例。
在下文中一共展示了Student.create_by_csv方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_local
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def generate_local(cls):
students = Student.create_by_csv("data/students.csv")
mentors = Mentor.create_by_csv("data/mentors.csv")
year = 2016
location = "Budapest"
local_class = CodecoolClass(location, year, students, mentors)
return local_class
开发者ID:CodecoolBP20161,项目名称:a-mentor-s-life-in-an-oo-way-technocoolrapid,代码行数:9,代码来源:codecool_class.py
示例2: generate_local
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def generate_local(cls):
local_class = cls("Budapest", 2016)
mentors = Mentor.create_by_csv("./data/mentors.csv")
students = Student.create_by_csv("./data/students.csv")
for mentor in mentors:
local_class.mentors.append(Mentor(mentor[0], mentor[1], int(mentor[2]), mentor[3], mentor[4]))
for student in students:
local_class.students.append(Student(student[0], student[1], int(student[2]), student[3]))
return local_class
示例3: generate_local
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def generate_local(cls):
mentors = Mentor.create_by_csv("data/mentors.csv")
students = Student.create_by_csv("data/students.csv")
events = Events.create_by_csv("data/events.csv")
retrospectives = []
for student in students:
retrospectives.append(student.retrospective_object)
education = Education.create_by_csv("data/education.csv")
local_codecool_class = cls("Budapest", 2016, mentors, students, retrospectives, events, education)
return local_codecool_class
示例4: generate_local
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def generate_local(cls):
cls.location = "Budapest"
cls.year = 2016
cls.mentors = Mentor.create_by_csv("mentors.csv")
cls.students = Student.create_by_csv("students.csv")
cls.attendance = cls.ATTEND[random.randint(0, len(cls.ATTEND)-1)]
cls.attention = False
print("Codecool {} {} is generated with {} mentors and {} students.".
format(cls.location, cls.year, len(cls.mentors), len(cls.students)))
return cls
示例5: generate_local
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def generate_local(cls): # returning an instance with these parameters
cls.location = "Budapest"
cls.year = 2016
cls.mentors = Mentor.create_by_csv('data/mentors.csv')
cls.students = Student.create_by_csv('data/students.csv')
print("School @{0}, in year {1} is created, with {2} mentors and 58 students.".format(
cls.location, cls.year, len(cls.mentors)))
input()
print("Let's not forget, that the other half of the floor was rented by Kovi")
return CodecoolClass(cls.location, cls.year, cls.mentors, cls.students)
示例6: __init__
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
def __init__(self, location, year, mentors, students):
mentor = Mentor("leves", "Dani", "Daniel", 1234, "male", 10, 10)
student = Student("leves", "Dani", "Daniel", 1234, "male", 10, 10)
lista = mentor.create_by_csv()
m = []
for i in range(len(lista)):
m.append(lista[i].first_name + " " + lista[i].last_name)
# m = lista[0].first_name + " " + lista[0].last_name
lista = student.create_by_csv()
s = []
for i in range(len(lista)):
s.append(lista[i].first_name + " " + lista[i].last_name)
self.location = location
self.year = year
self.mentors = m
self.students = s
开发者ID:CodecoolBP20161,项目名称:a-mentor-s-life-in-an-oo-way-backstreet-boys,代码行数:18,代码来源:codecool_class.py
示例7: Student
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
from codecool_class import CodecoolClass
from mentor import Mentor
from student import Student
from events import Events
import random
student = Student("leves", "Laci", "Jocó", 1234, "male", 10, 10)
mentor = Mentor("leves", "Dani", "Daniel", 1234, "male", 10, 10)
codecool_bp = CodecoolClass("Budapest", 2016, student.create_by_csv(), mentor.create_by_csv())
events = Events("fds", "2re", 3)
print("Codecool class generated")
print("Venue: " + codecool_bp.location)
print("Year: " + str(codecool_bp.year))
input("")
# print("\n")
# print(codecool_bp.mentors)
for i in codecool_bp.mentors:
print(i)
print("Mentors are ready")
input("")
# print("\n")
for i in codecool_bp.students:
print(i)
print("Students are ready")
input("")
# print("\n")
print(codecool_bp.students[0] + " drank a coffee")
input("")
print("Energy of " + codecool_bp.students[0] + " increased from 30 to 55")
input("")
示例8: print
# 需要导入模块: from student import Student [as 别名]
# 或者: from student.Student import create_by_csv [as 别名]
from codecool_class import CodecoolClass
from electronic import Electronic, Laptop
from feedback import Feedback
from mentor import Mentor
from student import Student
from colors import Colors
print(Colors.OKBLUE + "\nThe ACT presents an (almost) average day in codecool." + Colors.ENDC)
skip = input()
miki = Mentor.create_by_csv()[0]
dani = Mentor.create_by_csv()[1]
tomi = Mentor.create_by_csv()[2]
print("Mentors are initialized from CSV.")
skip = input()
móni = Student.create_by_csv()[0]
beru = Student.create_by_csv()[1]
beni = Student.create_by_csv()[3]
print("Students are initialized from CSV.")
skip = input()
print("School @ Budapest, in year 2016 is created, with 3 mentors and 4 students.")
skip = input()
print("Examine a mentor.. for example Dani.")
skip = input()
print("Nickname: {}\nKnowledge level: {}\nEnergy level: {}\nJoy level: {}".format(
dani.nickname, dani.knowledge_level, dani.energy_level, dani.joy_level))
print("He has more attributes, but it's not necessary for now.")
skip = input()
l = Laptop("HP", False, True)