Lecture # 27 Python I. Python “Interpretive” language (vs. compiled) So is HTML, JavaScript. Python supports file I/O. JavaScript doesn’t Python is a.

Slides:



Advertisements
Similar presentations
ASP.NET Intro An introduction to the languages and communication of an ASP.NET system.
Advertisements

1 CGICGI Common Gateway Interface Server-side Programming Lecture.
Introduction to JavaScript
The Web Warrior Guide to Web Design Technologies
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.
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
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.
Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.
James Tam Programming: Part I In this section of notes you will learn how to write simple Jython programs using JES.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
HTML Recall that HTML is static in that it describes how a page is to be displayed, but it doesn’t provide for interaction or animation. A page created.
Scite Scintilla integrated text editor. Click here.
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
JavaScript Lesson 1 TBE 540. Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or.
Introduction to JavaScript for Python Programmers
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Javascript & HTML5 Intro. Why Javascript? Next big thing in online games Flash is slowly on its way out Can be coded via any text editor, flash costs.
Python.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
CS 102 Computers In Context (Multimedia)‏ 01 / 28 / 2009 Instructor: Michael Eckmann.
CS 101: Introduction to Computing Programming picture manipulations Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by.
Download JES Tool JES: Jython Environment for Students
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
Python Basic Syntax. Basic Syntax - First Program 1 All python files will have extension.py put the following source code in a test.py file. print "Hello,
Introduction to Programming Peggy Batchelor.
COMP 171: Principles of Computer Science I John Barr.
DUE Introduction to the Android Platform Working Connections 2011.
Java Applet Presented by: Feng Liu. Agenda Introduction Java Applet vs. JavaScript Steps in Creating a Java Applet Java Applet Example Do I have to write.
Algorithms A sequence of instructions 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour a 9x9 inch pan or line a muffin pan with paper.
Python programming Introduction to the JES environment and basics of Python Reading: Chapters 1, 2 from “Introduction to Computing and Programming in Python”
CS1315: Introduction to Media Computation Introduction to Programming.
CS 100 Introduction to Computing Introduction to JES Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by Robert H. Sloan.
CSC 110 Using Python [Reading: chapter 1] CSC 110 B 1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #001 (January 17, 2015)
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Unit 1 Basic Python programs, functions Special thanks to Roy McElmurry, John Kurkowski, Scott Shawcroft, Ryan Tucker, Paul Beck for their work. Except.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
01-IntroToMediaComp1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
1 CS 177 Week 2 Recitation Slides Variables, Files and Functions.
CS1315: Introduction to Media Computation Introduction to JES.
1/10/2008. >>> About Us Paul Beck * Third quarter TA * Computer Engineering * Ryan Tucker * Second quarter TA * Computer.
CS1315: Introduction to Media Computation Introduction to Programming.
8/2/07. >>> About Me Scott Shawcroft * Junior * Computer Engineering * Third Quarter TA * Creative Commons Intern * Small-time Open Source Developer
Intro CS and Media Computation1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
Python programming Using the JES picture functions and defining new functions.
CS1315: Introduction to Media Computation Introduction to JES.
Machine Language Computer languages cannot be directly interpreted by the computer – they are not in binary. All commands need to be translated into binary.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Multimedia Summer Camp
CST 1101 Problem Solving Using Computers
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Lecture Bells and Whistles.
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
JAVA Script : Functions Ashima Wadhwa
CS1315: Introduction to Media Computation
basic Python programs, defining functions
Functions CIS 40 – Introduction to Programming in Python
Chapter 2: Introduction to Programming
Chapter 2: Introduction to Programming
basic Python programs, defining functions
INFO/CSE 100, Spring 2005 Fluency in Information Technology
1.3.7 High- and low-level languages and their translators
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
Introduction to Python
Presentation transcript:

Lecture # 27 Python I

Python “Interpretive” language (vs. compiled) So is HTML, JavaScript. Python supports file I/O. JavaScript doesn’t Python is a serious web programming language used by Google, ILM, etc.

Jython Jython is a “dialect” of Python Python is implemented in C Jython is implemented in Java We use JES JES = Jython Environment for Students

Downloading Jython jes/downloads/list

Using Jython Select JES from “Programs” Click on the black part of the UI after the command prompt >>>

Jython DEMO print print “Hello” x = print x message = “Hello There” print message

Jython DEMO print print “Hello” x = print x message = “Hello There” print message Note: Python is case sensitive. “Print” and “Message” won’t work.

Jython DEMO Pictures pickAFile()

Jython DEMO Pictures pickAFile() print pickAFile()

Jython DEMO Pictures pickAFile() print pickAFile() file = pickAFile()

Jython DEMO Pictures pickAFile() print pickAFile() file = pickAFile() print file

Jython DEMO Pictures pickAFile() print pickAFile() file = pickAFile() print file pict=makePicture(file) # interpret as picture

Jython DEMO Pictures pickAFile() print pickAFile() file = pickAFile() print file pict=makePicture(file) # interpret as picture show(pict) # display as picture

How could we do this all at once?

show(makePicture(pickAFile()))

How could we do this all at once? show(makePicture(pickAFile())) Now lets save it as a Python Program: displayPict.py

How could we do this all at once? show(makePicture(pickAFile())) Now lets save it as a Python Program: displayPict.py And run it: open it and load it

How could we do this all at once? show(makePicture(pickAFile())) Now lets save it as a Python Program: displayPict.py And run it: open it and load it King of the “1-liners”

Jython DEMO Sound file = pickAFile() print file sound=makeSound(file) # interpret as sound play(sound) # lets listen to it All together: play(makeSound(pickAFile())) Save as a Python program and run it

Jython Functions def myFunction(): colon

Jython Functions def myFunction(): colon parentheses

Jython Functions def myFunction(): colon parentheses function name

Jython Functions def myFunction(): colon parentheses function name “def” instead of “function()”

Jython Functions def myFunction(): colon parentheses function name “def” instead of “function()” The function must be called somewhere

Jython Functions def myFunction(): block of commands

Jython Functions def myFunction(): block of commands Note indentation!

Jython Functions: Indentation Indentation is critical in Python Indentation associates these commands with this function Indentation separates commands from other functions

Jython Function: Example def pickAndShow(): file = pickAFile() myPict = makePicture(file) show(myPict) pickAndShow()# somewhere we have to call the function