Make a blank window This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In script mode create a file.

Slides:



Advertisements
Similar presentations
Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
Advertisements

Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
What is Classrooms? Classrooms is a module of Schoolnet that: Provides teachers with standards-based instructional tools, lessons and best practices Delivers.
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Aim: Use the given examples to record examples and our own ideas in our journal 1.Write technical examples in journal and/or participate in full.
1 BMB teaching initiative: Inking, wireless, capture UMass Amherst A template for easy inking in powerpoint.
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.
Windows Basics: Desktop, Taskbar and Window
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
Introduction to Scratch!
Student Support Services Laptop Workshop. What will you Find The actual Computer The Power Cord (Comes in two parts.)
PowerPoint 1 The Basics 1. Save this file to your Apps Folder as YourLastName_PP1 2. Read each slide. 3. Complete each set of numbered directions.
Spiral Rider PAGE 1. Set Up Scene 1.Add Stage-underwater scene 2.Add crab sprite 3.Add two fish sprites PAGE 2.
Programs, programs, everywhere! This is a starter activity and should take 5 minutes 1.Open up a text editor such as Notepad. 2.Write a list of all the.
Copy, paste, amend This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open myEtchASketch.py in IDLE 3.Check you.
Singapore Schools Sports Council User Guide. Table of Contents How To Login How To Logout How To Add Games Content (Same for ASG) How To Edit Games Content.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Type accurately challenge! This is a starter activity and should take 2 minutes [ slide 1 ] 1.Can you type out the code in Code Box 2.1 with no errors.
Keyboard Fun! We will have some fun typing our name! 1.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
Fill the screen challenge! This is a starter activity and should take 3 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In interactive mode,
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
 You will be creating a cartoon in Adobe Illustrator using the paintbrush tool  You will learn about layers, different brushes, and different strokes.
Make a dice challenge! This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Copy the code below in.
Lesson 3 - The Entry Box.. Last week We produced a Tkinter window with a label and a button Now we are going to create a new program that creates a Button.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
1 Building Your Own Turtle Functions For making really cool pictures!
Coding Time This is a starter activity and should take about 10 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Start a script session (Select.
To view this in “presentation” mode, go to Slide Show  View Show (the toolbar at the top of the page) Use the “Enter” key to advance to the next slide.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Click on this button to move to the previous slide of your notebook. Click on this button to move to the next slide of your notebook. Click on this button.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
CSx 4091 – Python Programming Spring 2013 Lecture L2 – Introduction to Python Page 1 Help: To get help, type in the following in the interpreter: Welcome.
Turtle Graphics Lesson 2 1. There are 3 homeworks to complete during the six lessons of this unit. Your teacher will let you know when a homework has.
Lesson 1 PowerPoint Vocabulary Pretest 1.Clear your desk of everything except a pen or pencil. No Phones!!!! 2.Stay silent until everyone has completed.
What do you think this lesson is all about? Write your answer on a sticky note.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Make a function This is a starter activity and should take 5 minutes [ slide 1 ] >>> def count(number): n=1 while n
Windows App Studio Windows App Studio is the tool that makes it fast and easy to build Windows 10 apps. It’s accessible from any device with a browser.
Scratch Helicopter Game
Development Environment
Introduction to Python
Explain what touch develop is to your students:
Chapter 2/Module 2: Computer and managing files
Completing the tasks for A452 with….
Explain what touch develop is to your students:
Let’s make a shape…. Move!
Fill the screen challenge!
Today’s lesson – Python next steps
Introduction to TouchDevelop
Learning Outcomes –Lesson 4
Lesson Aims Vocabulary In this lesson you are going to:
WICS - Flappy Anteater Python Tutorial
Introduction to TouchDevelop
Explain what touch develop is to your students:
Lesson 20 Getting Started with PowerPoint Essentials
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Explain what touch develop is to your students:
Explain what touch develop is to your students:
Chapter 8 - Functions and Functionality
Python Modules.
Chapter 1 Introducing Small Basic
Presentation transcript:

Make a blank window This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In script mode create a file called myEtchASketch.py 4.Copy the code from Code Box 5.1 on page 57, save it and run it. If you are waiting: 1. Read pages 56 and 57 2.Try changing the variables, re-save and re-run to see what happens. (Don’t forget to put them back.)

Lesson Aims [ slide 2 ] Vocabulary tkinter global variables local variables default values In this lesson you are going to: 1.learn how to use the tkinter library 2.start to build your own MyEtchASketch game 3.learn how to put an application in its own window 4.add keyboard control to your game

The Plan [ slide 3 ] In the next two lessons you are going to build an Etch A Sketch® game. These are the jobs that need doing: 1.Write four functions that draw lines up, down, left and right. 2.Attach these functions to keys on the keyboard 3.Add a function for clearing the screen

tkinter [ slide 4 ] To create the window at the start of the lesson we imported the tkinter library like this: tkinter is a whole collection of modules called a package It provides us with code that we can use to create windows, lines, buttons, canvases to draw on and a whole heap more We will use this package a lot from now on. from tkinter import * This means everything in the library

Coordinates on computers [ slide 5 ]

Keeping Code Organised [ slide 6 ] Keeping your code organised is very important! Read pages 58 and 59 in Python Basics. Open myEtchASketch.py (if you have shut it.) Add the new code from Code Box 5.2 as indicated on pages 60 and 61 p1 stands for player 1 p1_x is the variable that stores the current x-coordinate of player 1’s line.

Code Analysis [ slide 7 ] Building little lines: Your code sets the lines to be 5 pixels high and 5 pixels wide – which makes little squares. ##### Set variables: canvas_height = 400 canvas_width = 600 canvas_colour = "black" p1_x=canvas_width/2 p1_y=canvas_height p1_colour="green" line_width=5 line_length=5 ##### Functions: # player controls def p1_move_N(self): global p1_y canvas.create_line(p1_x, p1_y, p1_x, (p1_y-line_length), width=line_width, fill=p1_colour) p1_y = p1_y - line_length

Homework 1.Read pages to review today’s lesson. 2.Read the section on adding keyboard control to your game on page 65. (This is actually very easy!) 3.Add the code from Code Box 5.3 on page 66 to your file and test your app so far. [ slide 8 ]

Lesson Summary [ slide 9 ] In this lesson you have: Vocabulary tkinter local variables global variables Variables that are available throughout an app Variables that are only available in a function A module of tools to help us create windows, etc. 1.learnt how to use the tkinter library 2.started to build your own MyEtchASketch game 3.learnt how to put an application in its own window default value A value given to an argument as a starting point