當前位置: 首頁>>代碼示例>>Python>>正文


Python Course.print_course方法代碼示例

本文整理匯總了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()
開發者ID:bpross,項目名稱:MyCourses-Scheduler,代碼行數:19,代碼來源:algo_config.py

示例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()
開發者ID:bpross,項目名稱:MyCourses-Scheduler,代碼行數:32,代碼來源:prof_course_test.py


注:本文中的course.Course.print_course方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。