本文整理汇总了Python中course.Course.print_course方法的典型用法代码示例。如果您正苦于以下问题:Python Course.print_course方法的具体用法?Python Course.print_course怎么用?Python Course.print_course使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类course.Course
的用法示例。
在下文中一共展示了Course.print_course方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_course_list
# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import print_course [as 别名]
def get_course_list(self):
from algorithm.models import School, Department, Class, Prerequisite, Building, Room, Period, Lecturer, ClassInstance, ClassLab, Person, Role, PersonRole
from course import Course
print "This will print out all the courses currently in the database"
self.course_list = []
all_courses = Class.objects.all()
for Class in all_courses:
new_course = Course()
new_course.id = Class.idClass
new_course.name = Class.Class
self.course_list.append(new_course)
self.num_courses += 1
for Course in self.course_list:
Course.print_course()
示例2: Course
# 需要导入模块: from course import Course [as 别名]
# 或者: from course.Course import print_course [as 别名]
p2.add_id(42)
p2.add_name('name')
# Test access functions using variables initialized above
num = p1.get_id()
name = p1.get_name()
num2 = p2.get_id()
name2 = p2.get_name()
# Print statment to insure that the variables
print "Professors name is %s,\n professor's ID is %d" % (name, num)
print "Professors name is %s,\n professor's ID is %d" % (name2, num2)
p1.print_professor()
c1 = Course(84, 'CMPS')
c2 = Course()
c2.add_id(48)
c2.add_name('CMPE')
c_id = c1.get_id()
c_name = c1.get_name()
print "Course name is %s,\n course ID is %d" % (c_name, c_id)
c2.print_course()
p1.add_course(c1)
p1.add_course(c2)
for course in p1.course_list:
course.print_course()