IST256 : Applications Programming for Information Systems

Slides:



Advertisements
Similar presentations
P3- Represent how data flows around a computer system
Advertisements

Creating and Editing a Web Page Using Inline Styles
Once the program is opened make sure the “Current Personality” is WebCT 6/ Vista 4 next click on “Import Questions” now you are ready to import your exams.
CIS101 Introduction to Computing Week 08. Agenda Your questions JavaScript text Resume project HTML Project Six This week online Next class.
Creating a Form on a Web Page
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Novell from Home Net Storage. Novell access via NetStorage 1-Web Interface Connect to your shared drive through your web browser Windows, Mac or Linux.
Registry 201 Excel Registry Training. Registry 201 Excel Registry Training Outline ► Important Information about PHI ► Getting to know you ► Excel Training.
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.
Microsoft Internet Explorer Capturing Text and Images From the Internet.
1 Introduction to Web Development. Web Basics The Web consists of computers on the Internet connected to each other in a specific way Used in all levels.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
THE BIG PICTURE. How does JavaScript interact with the browser?
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.
NEW TECHNICAL MANUALS | WHAT’S NEW WITH THE TECHNICAL MANUALS New look aligns with new branding.
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
1 Creating a Second Web Page This section shows you how to create the Huntington Beach Web site.
An Introduction to Front-end Web Development Tom Perkins.
How to make and publish a web page. Create a folder.
Academic Search Premier Saving search results: mailing, printing, saving University Library next = click.
Steps to help you … build content evaluate students.
Introduction to Programming Using C An Introduction to Operating Systems.
The Three Builders. The 3 Builders – Student Access to Unitedstreaming Resources! Quiz Builder Enables students to take a quiz online and/or view a movie.
Your Digital Technology Briefcase My information…when and where I need it.
HTML Concepts and Techniques Fifth Edition Chapter 4 Creating Tables in a Web Site.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
Endnote X1 & Hawaii Voyager Hawaii Voyager Users Meeting University of Hawaii at Manoa Library May 23, 2008.
HTML Concepts and Techniques Fifth Edition Chapter 3 Creating Web Pages with Links, Images, and Formatted Text.
Braille + Mobile Manager And NLS Books 1 Part 1: from the Computer Part 2: Using the Braille +
Copy of the from the secure website - click on the AccoridaLife.zip link.
Portaportal Portaportal is a web based bookmarking utility that lets you store links to your favorite websites online. Now your bookmarks are no longer.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Creating Web Pages with Links, Images, and Embedded Style Sheets
Feb Welcome To TU170 Arab Open University Jeddah Regional Branch.
Python: File Directories What is a directory? A hierarchical file system that contains folders and files. Directory (root folder) Sub-directory (folder.
Nat 4/5 Computing Science Software
what is computer programming?
Topic: File Input/Output (I/O)
COMP Streams and File I/O
Lesson 08: Files Class Participation: Class Chat: Attendance Code 
Week of 12/12/16 Test Review.
IST256 : Applications Programming for Information Systems
IST256 : Applications Programming for Information Systems
IST256 : Applications Programming for Information Systems
Little work is accurate
Barbara Palmer APD Director
And now for something completely different . . .
Python I/O.
File IO and Strings CIS 40 – Introduction to Programming in Python
Lesson 08: Files Topic: Introduction to Programming, Zybook Ch 7, P4E Ch 7. Slides on website.
Hashing with Python Protecting Digital Evidence
File Handling.
Lesson 09: Lists Topic: Introduction to Programming, Zybook Ch 8, P4E Ch 8. Slides on website.
Add Image and Title to Individual Page
Reading and Writing Text Files
IST256 : Applications Programming for Information Systems
IST256 : Applications Programming for Information Systems
Lesson 08: Files Class Chat: Attendance: Participation
Reading and Writing Text Files
Introduction to Internet Explorer
Python Basics with Jupyter Notebook
IST256 : Applications Programming for Information Systems
Input and Output Python3 Beginner #3.
Windows.
Introduction to JavaScript
IST256 : Applications Programming for Information Systems
Move the cursor to cell A1 of the ‘Input’ worksheet.
IST256 : Applications Programming for Information Systems
IST256 : Applications Programming for Information Systems
Presentation transcript:

IST256 : Applications Programming for Information Systems Files

Agenda Connection Activity Teaching: Practice Activity Strings String Library Practice Activity Sentiment Analyzer

Connect Activity Go Over Quiz Average The Process: Inputs? Outputs? Enter a quiz grade or type 'quit' : 100 Enter a quiz grade or type 'quit' : 100 Enter a quiz grade or type 'quit' : 40 Enter a quiz grade or type 'quit' : quit You took 3 quizzes Your average is 80 The Process: Inputs? Outputs? What is Needed? IO Loop? Write it without the loop then add the loop. YOU CANNOT WRITE IT IN ONE STEP… NEVER

Files == Persistence Files add a Persistence Layer to our programming where we can store our data after the program completes. We can also load other sets of data into our programs. When our program Stores data, we open the file for writing. When our program Reads data, we open the file for reading. To read or write a file we must first open it, which gives us a special variable called a file handle. We then use the file handle to read or write from the file. The read() function reads from the write() function writes to the file through the file handle.

Watch Me Code Let’s Write two programs. One to save a password to a file One to check the password as read from the file # Input Password from user and write it to a file. password = input("Enter your new password:") with open ("password.txt","w") as file: file.write(password) print("Password Saved!") def readpassword(): with open("password.txt","r") as file: password = file.read() return password password = readpassword() print (password)

Your Operating System and You Files are stored on your hard disk in folders. When the python program is in the same folder as the file, no path is required. When the file is in a different folder not, a path is required. Absolute paths point to a file starting at the root of the hard disk. Relative paths point to a file starting at the current place on the hard disk.

Python Path Examples What Windows Mac / Linux File in current folder “file.txt” File up one folder from the current folder “../file.txt” File down two folders from the current folder “folder1/folder2/file.txt” Absolute path to file in a folder “C:/folder1/file.txt” “/folder1/file.txt”

Watch Me Code Let’s Write two programs. One to save a password to a file One to check the password as read from the file Files and Exceptions # Input Password from user and write it to a file. password = input("Enter your new password:") with open ("password.txt","w") as file: file.write(password) print("Password Saved!") def readpassword(): with open("password.txt","r") as file: password = file.read() return password password = readpassword() print (password)

Help me Code Create a file with a list of quiz grades, one per line. Write a program to read the file and output the average of all the quizzes.

Prep: Now You Code Getting the Data File: Open a web browser to: http://www.pythonlearn.com/code3/mbox-short.txt Highlight all the text on the page (CTRL+A does this on a PC) Copy the text (CTRL+C does this on a PC) From Jupyter, create a new text file Paste in the text (CTRL+V does this on a PC) Save the file as mbox-short.txt

Now You Code Email Spammer Training 101 Write a program to “harvest” all of the emails from the mbox-short.txt file. Specifically: Look for lines beginning with “From:” and extract the email address from those lines. Suggested Approach Write the program to read the file and print EVERY line. Modify the program to only print the “From:” lines Modify the program to only print the emails. Sell the list on the open market and PROFIT!!!!