Multimedia Summer Camp

Slides:



Advertisements
Similar presentations
Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
Advertisements

CS1315: Introduction to Media Computation Introduction to Programming.
Created by Mark Guzdial, Georgia Institute of Technology; modified by Robert H. Sloan, University of Illinois at Chicago, For Educational Use. CS.
Media Computation in JES (Chapter 2) DM Rasanjalee Himali.
IT151: Introduction to Programming
 2005 Pearson Education, Inc. All rights reserved Introduction.
Python: Making colors and Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
Chapter 2: Introduction to Programming. Chapter Learning Objectives.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Introduction to programming in MATLAB MATLAB can be thought of as an super-powerful graphing calculator Remember the TI-83 from calculus? With many more.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
Python Programming Fundamentals
CS 101: Introduction to Computing Programming picture manipulations Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by.
Lecture # 27 Python I. Python “Interpretive” language (vs. compiled) So is HTML, JavaScript. Python supports file I/O. JavaScript doesn’t Python is a.
Introduction to Computational Linguistics Programming I.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Python programming Introduction to the JES environment and basics of Python Reading: Chapters 1, 2 from “Introduction to Computing and Programming in Python”
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
CS1315: Introduction to Media Computation Introduction to Programming.
CS 177 Week 4 Recitation Slides Variables, Files and Functions.
CS 100 Introduction to Computing Introduction to JES Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by Robert H. Sloan.
1 Chapter 12: Form Builder Objects and Flexible Code.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
1 CS 177 Week 2 Recitation Slides Variables, Files and Functions.
CS1315: Introduction to Media Computation Introduction to JES.
CS1315: Introduction to Media Computation Introduction to Programming.
Python programming Using the JES picture functions and defining new functions.
Adding a Picture in ArcGIS. Getting Started Open ArcMap in ArcGIS Add shape files Find pictures on the web save in folder with shape files you added to.
CS1315: Introduction to Media Computation Introduction to JES.
Lesson 08: Files Class Participation: Class Chat: Attendance Code 
Introduction to Programming
Introduction to Python
Introduction to Visual Basic 2008 Programming
Week 2.
Lesson 1 An Introduction
CS1315: Introduction to Media Computation
3.01 Apply Controls Associated With Visual Studio Form
Beginning C++ Programming
Basic operations in Matlab
3.01 Apply Controls Associated With Visual Studio Form
Functions CIS 40 – Introduction to Programming in Python
Download JES Tool JES: Jython Environment for Students
Microsoft Word 2003 Illustrated Complete
Chapter 2: Introduction to Programming
Chapter 2: Introduction to Programming
Introduction to Python
CS100J 26 April. Matlab Use help button!!! Variables, values, types
File IO and Strings CIS 40 – Introduction to Programming in Python
Lesson 08: Files Topic: Introduction to Programming, Zybook Ch 7, P4E Ch 7. Slides on website.
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
Video list editor BIS1523 – Lecture 24.
Introduction to Programming
Digital Image Processing
Introduction to Programming
Workshop for Programming And Systems Management Teachers
Fundamentals of Python: First Programs
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Using SQL*Plus.
CS 177 Week 3 Recitation Slides
Topics Introduction to File Input and Output
Scripts In Matlab.
12th Computer Science – Unit 5
Introduction to Computer Science
Introduction to Programming
Introduction to Programming
Computer Programming-1 CSC 111
Workshop for Programming And Systems Management Teachers
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Multimedia Summer Camp Jython Environment for Students

Python Python – a programming language Used for years by people without formal computer science training Jython – a particular form of Python to enable cross-platform multimedia JES – Jython Environment for Students, which is a tool to develop Jython programs

JES A text editor for editing your programs A window where you can command the computer using Jython functions

Functions To be able to call the function pickAndShow in the command window, you need to Save the program to a file Click Load button to parse functions

JES Commands print Example Display a readable representation of whatever follows Example print 10 print “This is a string” print 5 + 7 print 3.0/2.0 print 3/2

JES Commands Common mistakes All JES commands are case senstive. So Print, PRINT, and pRiNt will not work. The results of expressions 3/2 and 3.0/2.0 are different. print 3/2 #You will get 1 print 3.0/2.0 #You will get 1.5

JES Commands pickAFile() Allows you to pick a file from your disk through a popup window. The name of the chosen file is returned as a string File name consists of three parts: path: a sequence of folders containing the file base file name: the name of the file file extension: the type of the file

JES Commands Example: print PickAFile() C:\zdong\temp\camp\work\soccer.jpg C:\zdong\temp\camp\work\ is the path soccer is the base file name jpg is the file extension \ is the path delimiter

JES Commands pickAFile is actually a function. A function is a “box” that accepts input values, performs some calculations, and returns or outputs the results. The pair of parenthesis () following the function name is used to enclose input values. That’s why () is needed when pickAFile is called.

JES Commands makePicture( a_JPEG_file_name ) Example Create a picture from a JPEG file, which has the file extension jpg. It requires one input value: a JPEG file name Example print makePicture( pickAFile() )

JES Commands show( picture ) Example: Display the given picture in a popup window The picture must be created from the function makePicture. Example: show( makePicture( pickAFile() ) )

JES Commands Naming your data Example: Values can be stored in a name and be retrieved later Using = to name data Example: myvalue = 12 Values are substituted for the names when the expression is evaluated. print myvalue #use print to check value

JES Commands Examples: result = 3 + 9 filename = “alice.jpg” An alternative way to the statement: show( makePicture( pickAFile() ) ) filename = pickAFile() picture = makePicture( filename ) show(picture)

JES Commands Tips for = Don’t read = as “equals”, read it as “Becomes a name for” myvalue = 12 thus means “myvalue becomes a name for 12”. name can be reused: myvalue = 12 myvalue = 5 + 9 myvalue = “filename”

Functions We can also name a sequence of commands, and then just use the name to execute the sequence of commands. Such a name is called function. A Jython program is a collection of one or more functions that perform a useful task.

Functions def - indicates the beginning of the function definition pickAndShow - the name of the function () - all input values should be placed in the pair of parenthesis : - indicates a block of commands is required A block is a sequence of commands with the same indentation.