上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture06 OBJECTS AND GRAPHICS GUI

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Computational Thinking and Approach Lecture 6 Dr.Jialiang LU Jialiang.lu@situ.edu.cn
Computational Thinking and Approach Lecture 6 Dr. Jialiang LU Jialiang.lu@sjtu.edu.cn

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY GUI OBJECTS AND GRAPHICS
OBJECTS AND GRAPHICS GUI

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Outlines ·The Object of Objects 。 Simple graphics programming Using Graphical Objects Interactive Graphics ·Displaying Images ·Playing music
Outlines • The Object of Objects • Simple graphics programming • Using Graphical Objects • Interactive Graphics • Displaying Images • Playing music

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY The Object of Objects The basic idea of object-oriented programming is to view a complex system as the interaction of simpler objects. ·An object consists of -A collection of related information. -A set of operations to manipulate that information. Objects may refer to other objects. Objects interact by sending each other messages (requests for an object to perform one's operations)
The Object of Objects • The basic idea of object-oriented programming is to view a complex system as the interaction of simpler objects. • An object consists of – A collection of related information. – A set of operations to manipulate that information. • Objects may refer to other objects. • Objects interact by sending each other messages (requests for an object to perform one’s operations)

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Example:time Specification Old style ·Develop a daily time m hours =6 system - m_minutes 30 Morning-call time 6:30:00 -m_seconds =0 Lunch time 12:00:00 I hours 12 Sport time 18:00:00 -I minutes =0 -Iseconds =0 -s hours =18 -s_minutes 0 -s_seconds =0 printTime (hours,minut es,seconds)
Example: time Specification • Develop a daily time system – Morning-call time 6:30:00 – Lunch time 12:00:00 – Sport time 18:00:00 Old style – m_hours = 6 – m_minutes = 30 – m_seconds = 0 – l_hours = 12 – l_minutes = 0 – l_seconds = 0 – s_hours = 18 – s_minutes = 0 – s_seconds = 0 printTime(hours,minut es,seconds)

上降充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Object-Oriented Style Define myTime Create object 。myTime: 。mtime=myTime() hours mtime.hours 6 -minutes mtime.minutes 30 seconds -mtime.seconds 0 ·function ·mtime.printTime() printTime() 。ltime=myTime() ·stime=myTime()
Object-Oriented Style Define myTime • myTime: – hours – minutes – seconds • function – printTime() Create object • mtime = myTime() – mtime.hours = 6 – mtime.minutes = 30 – mtime.seconds = 0 • mtime.printTime() • ltime=myTime() – ... • stime=myTime()

上游充通大学 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY OOP:a good practice of data structure Data structure Data Operation ·OOP Define a type of objects Data associated with the object Operations applicable on the object - Create and use the object through construction and methods
OOP: a good practice of data structure • Data structure – Data – Operation • OOP – Define a type of objects • Data associated with the object • Operations applicable on the object – Create and use the object through construction and methods

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Simple Graphics Programming Most applications you're familiar with have Graphical User Interfaces (GUl)that provide windows,icons,buttons and menus. 74 Celsius Converter ▣☒ Celsius Temperature: 35 Quit Fahrenheit Temperature: 95.0
Simple Graphics Programming • Most applications you’re familiar with have Graphical User Interfaces (GUI) that provide windows, icons, buttons and menus

上游充通大 ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Simple Graphics Programming Tkinter Python comes with its own standard GUl module called Tkinter. ■graphics.py a simple object oriented graphics library for you Two location choices In Python's Lib directory with other libraries In the same folder as your graphics program
Simple Graphics Programming Tkinter Python comes with its own standard GUI module called Tkinter. graphics.py a simple object oriented graphics library for you Two location choices In Python’s Lib directory with other libraries In the same folder as your graphics program

上游通大¥ ParisTech SHANGHAI JIAO TONG UNIVERSITY INSTITUT DES SCIENCES ET TECHNOLOGIES PARIS INSTITUTE OF TECHNOLOGY Graphics.py is an OO Packet over Tkinter Graphics is developed over Tkinter and provide object-oriented library to user. graphics GraphWin Point Rectangle Oval circle Line Text Canvas c.create c.create_ c.create_ c.create rectangle oval line text Tkinter
Graphics.py is an OO Packet over Tkinter • Graphics is developed over Tkinter and provide object-oriented library to user
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture05 ITERATION Control Structure.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture04 MODULAR PROGRAMMING Functions.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture03 CONDITIONALS AND SEQUENCES Strings, lists and file objects.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture02.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture01.pdf
- 上海交通大学:《操作系统 Operating System》课程教学资料_往年试卷.pdf
- 上海交通大学:《操作系统 Operating System》课程教学资料_管程.docx
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)Java学习笔记(JAVA的面向对象编程——课堂笔记).doc
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)JAVA多线程编程详解(详细操作例子).doc
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)Java多线程编程.pdf
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)Java多线程应用实例(制作烟花效果).doc
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)Java Primer.pdf
- 上海交通大学:《操作系统 Operating System》课程教学资料(JAVA PPT)lec5.ppt
- 上海交通大学:《操作系统 Operating System》课程教学资料(JAVA PPT)lec4.ppt
- 上海交通大学:《操作系统 Operating System》课程教学资料(JAVA PPT)lec3.ppt
- 上海交通大学:《操作系统 Operating System》课程教学资料(JAVA PPT)lec2.ppt
- 上海交通大学:《操作系统 Operating System》课程教学资料(JAVA PPT)lec1.ppt
- 上海交通大学:《操作系统 Operating System》课程教学资料(Java)Java Introduction.docx
- 上海交通大学:《操作系统 Operating System》课程教学资源(课件讲稿)OS-thread.pdf
- 上海交通大学:《操作系统 Operating System》课程教学资源(课件讲稿)OS-OPERATING SYSTEMS(LINUX SYSTEM CALLS).pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture07 OBJECT ORIENTED DEVELOPMENT Class and Object.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture08 DATA COLLECTION Massive data representation and processing.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture09 SIMULATION AND DESIGN Real-world problem.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Lecture10 ALGORITHM DESIGN AND ANALYSIS To the Classic.pdf
- 上海交通大学:《Computational Thinking and Approach》教学资源(课件讲稿)Something You Should Know.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(学习资料)C++练习(题目).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(学习资料)C++练习(答案).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(学习资料)基于MFC的对话框程序.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(课件讲稿)总复习(共八讲).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第1讲 C++语言概述及数据类型(何其昌).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第2讲 C++程序的流程控制.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第3讲 函数与结构化程序设计.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第4讲 数组与结构.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第5讲 指针与引用.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第6讲 C++类(1/2).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第7讲 C++类(2/2).pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲稿)第8讲 Windows应用程序设计.pdf
- 上海交通大学:《C++程序设计与实践》课程教学资源(讲义)方波生成器项目报告书.doc
- 《中文信息学报》:中文组织机构名称与简称的识别.pdf
- 《计算机系统结构》课程教学资源(电子书籍)《Computer Organization and Design》THE HARDWARE / SOFTWARE INTERFACE(DAVID A. PATTERSON JOHN L. HENNESSY,Fourth Edtion,彩色版).pdf