Creating and Using Modules Sec 9-6 Web Design. Objectives The student will: Know how to create and save a module in Python Know how to include your modules.

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Advertisements

Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Copyright © 2003 Americas’ SAP Users’ Group Simple Document Management in Project Systems Kent Bettisworth BETTISWORTH & ASSOCIATES, INC. Tuesday, May.
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.
How to Compile Java in Windows. click start then run.
Putting Your PowerPoint into WebCT. To put your PowerPoint online Create an appropriate folder Upload the PowerPoint file to that folder Create a link.
CS 1 with Robots IDLE and Myro Institute for Personal Robots in Education (IPRE)‏
Digital Locker Today you will learn about your digital locker. You will- upload a file to your digital locker. reply to an .
How to install the Zelle graphics package
Lesson One: The Beginning
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Logo Lesson 2 Logo Procedures
This is a PowerPoint Presentation You can use this application to present ideas and information with text, pictures, sounds, animation, and video!
A Computer is Like a Filing Cabinet
JavaScript Development Tools Front-End Development.
How to turn on the robot How to start Bluetooth How to connect to robot How to initialize the robot How to not break the robot Sec Getting Started.
Simple Python Loops Sec 9-7 Web Design.
Taking Pictures Sec 9-9 Web Design. Objectives The student will: Know how command the scribbler robot to take a picture. Know how to display the picture.
HTML.
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Scribbler Movements Sec 9-3 Web Design. Objectives The student will: Understand the basic movement commands for the Scribbler Know how to create and execute.
First Program  Open a file  In Shell  Type into the file: 3  You did it!!! You wrote your first instruction, or code, in python!
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
 We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is.
Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
File Management Basics for Managing Your Files. What exactly is file management?  File management is the process of placing, naming, and organizing files.
Organising Files and Folders Module 1. Task 1 – Folder Structure Organising folders to store your work is a key factor to success. Organising folders.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
With Larry Anter (805) Website Facebook Twitter.
How to link the robot and the computer (Bluetooth) How to turn on and off How to connect the adaptor Fluke card connection Sec Getting Started How.
Simple Functions and Names Sec 9-4 Web Design. Objectives The student will: Know how to create a simple function in Python. Know how to call a function.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
Lesson 2 . Objectives Describe Understand how to send, reply, and forward Define and send attachments.
IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python.
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.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 4: Writing programs.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
SharePoint 2010 Key Parts to Navigation Shared Document Library Add/Remove item from Quick Launch Using the Search Choose a Topic.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
9/2/2015BCHB Edwards Introduction to Python BCHB524 Lecture 1.
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.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
1- How to connect the robot to the pc Sec Getting Started 3- How to move the robot Sec Scribbler movements 4- How to make a turn 11- How to.
1. Starting 1 Let’s Learn Saenthong School, January – February 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
First Program  Open a file  In Shell  Type into the file: 3  You did it!!! You wrote your first instruction, or code, in python!
Intelligent Data Systems Lab. Department of Computer Science & Engineering Python Installation guide 컴퓨터의 개념 및 실습.
Tips. Iteration On a list: o group = ["Paul","Duncan","Jessica"] for person in group: print(group) On a dictionary: o stock = {'eggs':15, 'milk':3, 'sugar':28}
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Comp1004: Introduction III Java. Content How Java Works: The JVM Writing a Class in Java – Class – Member Variables – Method – Statement Magic incantations.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
CST 1101 Problem Solving Using Computers
Whatcha doin'? Aims: To start using Python. To understand loops.
ivote A system for polling students in the class
Introduction to Programming
Introduction to Python
A Short DOS Presentation
Getting Started Sec 9-2 Web Design.
Week 1 Computer Programming Year 9 – Unit 9.04
PYTHON: BUILDING BLOCKS Inputs & Outputs
BIT 143: Programming & Data Structures in C#
Python Lesson’S 1 & 2 Mr. Kalmes.
CSCI N207 Data Analysis Using Spreadsheet
More to Learn Creating a shortcut
HOW TO CREATE BIBLIOGRAPHY:
The Python interpreter
Training Presentation For
Topic: Where to put functions in a program
Presentation transcript:

Creating and Using Modules Sec 9-6 Web Design

Objectives The student will: Know how to create and save a module in Python Know how to include your modules in IDLE.

Modules Once you start to create functions for Python you may want to store these functions and use them later in different program. The files in which you stores functions is called a module Modules are stored in files with an extension of.py (e.g. testrobots.py)

Creating a Module Start Python. From the File menu Select New Window Type in the functions – It’s always a good idea to comment the code so you can remember what the module and the functions do Save the file with a.py extension Save the file in the same folder as your start IDLE program

Including Modules in IDLE Once you save your program you “include” it in your IDLE window: from testrobots import * Now all the functions are available for use… Note that the lines not included in a function are executed immediately

Using Functions form a Module Once you have imported the functions you can simply call them:

Putting functions into modules helps keep things organized. Include the functions in your program by: from module import * – Once imported all functions can be used. Summary

Rest of Today Complete the program from yesterday. Show me the results when complete. – Everyone must do this!