Python 16 Mr. Husch.

Slides:



Advertisements
Similar presentations
Input and Output Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Advertisements

COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Chapter 2: Java Fundamentals Java Program Structure.
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Python programs How can I run a program? Input and output.
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.
Introduction to PythonIntroduction to Python SPARCS `08 서우석 (pipoket) `09 Summer SP ARCS Seminar`09 Summer SP ARCS Seminar.
Bringing Data into SAS From Menu: –File –Import Data –Spreadsheet example first Pick file by browsing Select Library and Member (we will talk about this.
Hey, Ferb, I know what we’re gonna do today! Aims: Use formatted printing. Use the “while” loop. Understand functions. Objectives: All: Understand and.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 4: Writing programs.
Chapter 5 Files and Exceptions I. "The Practice of Computing Using Python", Punch & Enbody, Copyright © 2013 Pearson Education, Inc. What is a file? A.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
Getting Started With Python Brendan Routledge
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 10: Files.
UW CSE 140 Section 1/10, Winter Find partners! Group can be 2-4 people. Try to share as much as possible about what you think with your teammates!
Test1 Here some text. Text 2 More text.
Fundamentals of Python: First Programs
Python 23 Mr. Husch.
A Playful Introduction to Programming by Jason R. Briggs
Python Lesson 12 Mr. Kalmes.
Python 14 Mr. Husch.
Lesson 1 An Introduction
Lecture Note Set 1 Thursday 12-May-05
Python Lesson 12 Mr. Kalmes.
Engineering Innovation Center
Python 18 Mr. Husch.
Python Lesson 6 Mr. Kalmes.
Python 17 Mr. Husch.
Python I/O.
Python Mr. Husch.
File Handling Programming Guides.
Topics Introduction to File Input and Output
Learning to Program in Python
Python Lessons 13 & 14 Mr. Kalmes.
[type text here] [type text here] [type text here] [type text here]
Your text here Your text here Your text here Your text here Your text here Pooky.Pandas.
Lists in Python Creating lists.
Python 9 Mr. Husch.
Python 21 Mr. Husch.
Python 17 Mr. Husch.
Python Lessons 9 & 10 Mr. Husch.
Your text here Your text here Your text here Your text here
Python 19 Mr. Husch.
[type text here] [type text here] [type text here] [type text here]
Python Lesson’S 1 & 2 Mr. Kalmes.
Python 16 Mr. Husch.
Chapter 2: Java Fundamentals
Input and Output Python3 Beginner #3.
Python Lessons 7 & 8 Mr. Kalmes.
Python 3 Mr. Husch.
Python Inputs Mr. Husch.
Python Lessons 13 & 14 Mr. Husch.
Python 19 Mr. Husch.
Python Lessons 7 & 8 Mr. Husch.
Python 10 Mr. Husch.
Python 18 Mr. Husch.
Python 12 Mr. Husch.
Python 4 and 5 Mr. Husch.
Python 8 Mr. Husch.
Python 13 Mr. Husch.
Basic 9 Mr. Husch.
Topics Introduction to File Input and Output
BASIC 17 Mr. Husch.
UW CSE 190p Section 6/28, Summer 2012 Dun-Yu Hsiao.
Presentation transcript:

Python 16 Mr. Husch

Aim Students will gain a list of commands that should be used other than open for reading and writing files.

What commands do you already know? Here are new commands. close -- Closes the file. Like File->Save.. in your editor. read -- Reads the contents of the file, you can assign the result to a variable. readline -- Reads just one line of a text file. truncate -- Empties the file, watch out if you care about the file. write(stuff) -- Writes stuff to the file.

Save as lastname16

Test run To run the program you need to open it in the CMD. After you find the file to run it you will need to type in Python lastname16.py yourname

Additions to make before turning in. 1) Place one comment line on each section of code to better understand what is occurring 2) See if you can streamline the file by using strings, formats, and escapes in line1, line2, and line3 with just one target.write commands

16.2 Now you need to see if you can really alter a file with another file. You will need to first make a simple file that prints out one or two lines. Then you will need to make the new file that you can use to alter this first one like in the example.