Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Digital Blue Cameras Inset Tuesday 3 rd June 2008.
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Mouse Tutorial for Win XP In this tutorial you will learn to: Move the mouse Click and double click Make selections Manage windows Use menus Click the.
The Writing Process Communication Arts.
Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
How to use a scanner Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic.
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
The Writing Process.
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Alice Variables Pepper. Set to Java look Edit / preferences restart.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
SELECT A LESSON 1. A WORLD AND CHARACTERS 2. PATHS AND ENEMIES 4. USING PAGES TO CHANGE THE RULES 5. GAME ANALYSIS AND DESIGN 6-7. CREATING YOUR OWN GAME.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Lesson 3: Removing objects. Starter: Open the powerpoint from O:\ Drive 1. Double click “My Computer” on the desktop 2. Double click “O:\” 3. Double click.
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
The Writing Process My Favorite Things.
Tutorial for Arrays and Lists By Ruthie Tucker. Description This presentation will cover the basics of using Arrays and Lists in an Alice world This presentation.
Introduction to TouchDevelop
Introduction to Scratch!
 Make sure you are subscribed to announcements on Moodle.  Activity 4 will be due 48hrs after your lab ends.
Class Usability Experience User slides are in BLUE.
© Mark E. Damon - All Rights Reserved Another Presentation © All rights Reserved
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.
PROJECT LOG MOLLY ATKINSON. 10/09 Today, I got to grips with the course outline, which included creating the relevant folders for all my future publications,
Sports Website Creation. In this project you will design and produce your own website.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
Optimizing Your Computer To Run Faster Using Msconfig Technical Demonstration by: Chris Kilkenny.
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.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
1 Quiz Template: Using the ‘ask user’ functions By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2009.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Matthew Glenn AP2 Techno for Tanzania This presentation will cover the different utilities on a computer.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Lesson 1. Security At the menu bar at the top you will see the word Tools. Click your mouse on Tools scroll down to Macro. Move the Mouse over and down.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
Photoshop Actions Lights, Camera, Actions in Photoshop.
Subtractive Manufacturing Exercise #1 Step #2 Key Fob Project Using Velocity CNC Software for the CNC Milling Machine Note: In order to use this set of.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
How do I multiply a triple digit number by a double digit? 145 x 67 = ? 267 x 19 = ? I’m sure that you’ll agree that there are many methods that we can.
How to create a basic game in Scratch. The Scratch Stage The Scratch stage is 480 pixels wide and 360 pixels high x increasesx decreases.
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Graphics in Python On entry: Run Python 2.78 from N: drive/computing and ICT VLE: Computing home page - check your feedback Success criteria: ●Understands.
Installing a Moodle Test Site The painless and easy way.
Getting Started With Alice: The Basics. Step 1: Background Open up Alice, and choose a background for your Alice world. Your world is something you can.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
MOM! Phineas and Ferb are … Aims:
Pixels, Colors and Shapes
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
Paddle Ball! We will begin creating, in steps, a video game similar to ‘brick breaker’ or ‘pong’, were we can move paddles to hit a bouncing ball. I hope.
Introduction to Object-Oriented Programming
Log onto a computer first then ….
Alice Variables Pepper.
Go to =>
Go to =>
Whatcha doin'? Aims: Begin to create GUI applications. Objectives:
creating a ecosystems model in net logo
Chapter 1 Introducing Small Basic
Chapter 9 Using Decisions to
Agenda for Unit 5: Control Structures
Presentation transcript:

Making Python Pretty!

How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put a screen capture of your code into the presentation when you are asked to. When you see a green box with a python, put your own notes & answers in.

I’m stuck!!! 1 – Read the instructions again. 2 - Check the notes in your folder. 3 – Ask someone sitting close by THEN – ask me!

Tell Me How it’s Going… Use the square at the top of each slide to tell me how you are feeling about the task by changing the colour. I’m OK! It’s hard, but I’m trying! I’ve tried 3b4Me and I’m stuck!

Is There Any Homework? Yes! The first lesson of every week, you are still handing in a Takeaway Homework Task of your choosing.

Tkinter – The Visual Tool So far we have worked with command line. A GUI is an interface that contains images & buttons G raphical U ser I nterface

Things to remember about a GUI indows cons enus ointers

What are we creating? Our objective over the next few lessons is to create a version of noughts and crosses which will allow you to: Create buttons Use labels Manipulate an array Create line drawings

Creating Your Code To create a GUI, you will need to import the tkinter library file. A library file is a…

Creating Your Code Next, we need to create a window. Give your window a title and a width & height. The frame is the window the program runs in &.pack() places things in the screen. When I ran my code, my screen looked like this:

Creating Your Code After our frame.pack(), add in the following two frames to organise the items on the screen. When I call a function with a variable name in it, this is called a …. These allow me to…

Creating Your Code Next, we will create out noughts and crosses board. This is a square where we will draw the lines to make Os & Xs. A canvas works by creating a grid of pixels which use coordinates to draw. This works in a similar way to vector graphics. A pixel is…. A vector graphic is useful because….

Creating Your Code In this code, I am using labels instead of the ________ function that I used in command line. Labels are better for users because….. Our next challenge is to create some labels which will show messages to our user.

Creating Your Code When I run my code, it looks like this: The final line of the program is window.mainloop() This allows your program to run all of its code. As you add new code into your program, this should remain the final line of your code.

Creating Your Code A noughts and crosses board looks like _______. Therefore, my array must look like ______. The next stage is to create the variables. These are an integer to count turns, and a 2 dimensional array for the board.

Creating Your Code Procedures are good practice when coding because: The next stage is to create a procedure which draws a O or a X on the canvas. This code is on the next slide! Your procedure goes in here (between import & turn = 1):

Procedure Annotate this code to explain what it does. The first one has been done for you… This procedure expects 8 parameters!

The Alpha Test When I run my code, it looks like this: So far the errors I have found have been… I fixed them by…. There are three types of testing: Alpha, Beta & Acceptance Alpha testing happens while the developer is still coding.

Getting Cross (or Nought) Draw an algorithm to show the process of clicking a button to run the procedure we have just written: Right now, we have a procedure to write a shape onto the board, but no event to trigger the code to run. For this game, our trigger will be our user clicking a button on the screen to tell us which square they want to play. Plan first!

Creating Your Code Using lambda before the procedure means that it isn’t run until the button is clicked. Why is this important?: TLbtn is the name created for ‘Top Left Button’ – you can give this a name that means something to you. Each of these numbers relates to a parameter in the drawStuff procedure. 1 – x coordinate 1 – y coordinate 60 – left for oval 50 - top for oval 10 – point 1 of cross 10 – point 2 of cross 100 – point 3 of cross 100 – point 4 of cross

Understanding Your Code We have now coded one out of nine squares. Change the screen shot to one of your program & explain what is on the screen so far…

Buttons Buttons Everywhere Now we need to create a button for all 9 of the noughts and crosses board. Don’t worry, we’ve already worked out the coordinates for you!

Understanding Your Code We have now coded nine out of nine squares. Change the screen shot to one of your program & explain what is on the screen so far…

Procedure 2 When testing my game, I’ve found that it isn’t finished yet because…. You may have noticed in our first procedure that we included a procedure call to checkStuff() but hadn’t written it yet. We are now going to write this below the drawStuff() procedure.

Procedure 2 If all three are the same, you win! Annotate this code to explain what it does. The first two have been done for you… This writes each line of the array out to a label

Understanding Your Code We have now coded the part of our code which checks for a winner! Change the screen shot to one of your program & explain what is on the screen so far…

Procedure 3 The variables I may need to reset to start my game again are…. If I didn’t reset these variables, my game would…. We’re nearly there! Our final part of the program is to clear the board and restart the game. We can do this with a button and one final procedure which resets all of our variables.

Procedure 3 Annotate this code to explain what it does. The first one has been done for you… This removes all our drawings (lines & ovals)

Click Me! Now I have finished my code, when I run my program it looks like this: delbtn is the name created for ‘Delete everything Button’ – you can give this a name that means something to you. This button code is placed after the game buttons that we have already created.

Test It! A standard data test means…. An erroneous data test means…. An extreme data test means…. Once a program has been written, it must be tested. Complete the testing table on the next slide and add in your own tests for standard, erroneous and extreme data.

Test It! Test No. Test DescriptionExpected Outcome Actual Outcome Evidence 1Click the top right button as player 1 An X appears in the top right square success! 2Click the top row as player 2 When three Os appear, label says ‘Os Win!’ 3 4 5

Test It More! I tried to break the game by…. Some errors I found were…. It was good because…. Once a program has been written and tested, you are ready to try Beta Testing. Ask a friend to test your game and fill in the box below.

Evaluate It! My game met the criteria of noughts and crosses because…. I think I developed my code [well? Ok? Brilliantly?] because…. Some feedback I had was…. It was good / bad because…. In future, I could improve….. You have reached the end of your development cycle. You have planned, developed and tested, which means it’s time to evaluate.