UW CSE 140 Section 1/10, Winter 2013. Find partners! Group can be 2-4 people. Try to share as much as possible about what you think with your teammates!

Slides:



Advertisements
Similar presentations
Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Advertisements

UW CSE 190p Section 6/21, Summer 2012 Dun-Yu Hsiao.
ENEE150: Discussion 1 Section 0104 Please Sit Down at a Computer and Login!
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Chapter Nine Advanced Shell Scripting1 System Programming Advanced Shell Scripting.
The Python interpreter CSE 140 University of Washington Michael Ernst.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
Intro Python: Variables, Indexing, Numbers, Strings.
Next Unix Topics Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14) ssh to account on – faclinux.cse.ohio-state.edu – stdlinux.cse.ohio-state.edu passwd.
File I/O Michael Ernst UW CSE 140 Winter File Input and Output As a programmer, when would one use a file? As a programmer, what does one do with.
Intro to Programming Environment 1. Today You Will Learn how to connect to a machine remotely with “nomachine NX client” Learn how to create a new “source.
Linux and Java Basics. What is Linux? Operating system by Linus Torvalds that was a clone of Unix (thus Linux) Free and open source – this is the reason.
40 Years and Still Rocking the Terminal!
CS252: Systems Programming Ninghui Li Slides by Prof. Gustavo Rodriguez-Rivera Topic 7: Unix Tools and Shell Scripts.
The Python interpreter CSE 160 University of Washington Ruth Anderson 1.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
ENEE150: Discussion 1 Section 0104/0105 Please Sit Down at a Computer and Login!
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Exploring Spyder: An IDE for scientific computing
Extending MATLAB Write your own scripts and/or functions Scripts and functions are plain text files with extension.m (m-files) To execute commands contained.
Unix Fundamentals CS 127. File navigation cd - change directory cd /var/log cd /etc/apache2 cd ~/Desktop ~ is a shortcut for the home directory.
8/2/07. >>> About Me Scott Shawcroft * Junior * Computer Engineering * Third Quarter TA * Creative Commons Intern * Small-time Open Source Developer
Unix Lab Fall Shell Scripting ●Through the shell (LXTerminal) you can: ●Run programs. ●Interact with the file system. ●Change settings. ●Send/receive.
1 CSE 391 Lecture 5 Intro to shell scripting slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Bash Scripting CIRC Summer School 2016 Baowei Liu CIRC Summer School 2016 Baowei Liu.
Introduction to Unix for FreeSurfer Users
GRID COMPUTING.
ENEE150 Discussion 01 Section 0101 Adam Wang.
Fundamentals of Python: First Programs
Intro to shell scripting
CIRC Winter Boot Camp 2017 Baowei Liu
Intro to shell scripting
EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016
The Python interpreter
CSE 390a Lecture 5 Intro to shell scripting
CSE 374 Programming Concepts & Tools
Some Linux Commands.
The Linux Operating System
Shell Script Assignment 1.
Intro to shell scripting
CSE 303 Concepts and Tools for Software Development
Intro to UNIX System and Homework 1
The Python interpreter
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
Shells, Help, and Paths.
Java Intro.
Intro to shell scripting
Persistent shell settings; intro to shell scripting
Intro to shell scripting
Intro to shell scripting
CSE 303 Concepts and Tools for Software Development
Scripts In Matlab.
Lab 2: Terminal Basics.
Intro to shell scripting
Intro to shell scripting
Input and Output Python3 Beginner #3.
Python 16 Mr. Husch.
Intro to shell scripting
The Python interpreter
Intro to shell scripting
UW CSE 190p Section 6/28, Summer 2012 Dun-Yu Hsiao.
Presentation transcript:

UW CSE 140 Section 1/10, Winter 2013

Find partners! Group can be 2-4 people. Try to share as much as possible about what you think with your teammates!

Create an empty text file and save everything about what you try and what you get. You can also include your name and your teammate’s name in the file. this text file to TA after class if you still feel doubt about any part of the section.

Command Prompt in Windows Terminal in Mac/Linux

Show current directory/folder – pwd (on unix, linux, osx) – echo %cd% (on windows) List contents in the current directory/folder – ls (on unix, linux, osx) – dir (mostly only on windows) / on unix, linux, osx \ on windows

Change directory – cd Use “tab” to loop through path! Make directory – mkdir (on unix, linux, osx) – md (on windows)

Using interpreter Using script – python myprogram.py – python myprogram.py argument1 argument2 The operating system command shell/prompt is not the same as the Python interpreter

Create a table using print about the simple info of your team. The required variable fields are: First name, Last name, Month of birth in number, and Favorite color. Your code should start with: first_name = “Michael” last_name = “Ernst”... Example output: ”Michael Ernst, 1, likes green" "Dun-Yu Hsiao, 5, likes red"

Careful about the conversion between number and string Use str(some number)

Testing your program Making a speed conversion chart mph->kph – Chart the conversion: 10, 30, 40, 60, 75, 100mph – Print out example: 10mph 16.09kph... (Tedious, isn’t it?)

Use loop to reduce code repetition! For loop: for iterating_var in sequence: statements(s) for x in [ 10, 2, 43]: print( x )

s = 0 for x in [ 10, 2, 43]: s = s + x Equivalent to: s = 0 x = 10 s = s + x x = 2 s = s + x x = 43 s = s + x

s = 0 for x in [ 5, 6 ]: for y in [ 7, 8 ]: s = s + x + y Equivalent to: s = 0 x = 5 for y in [ 7, 8 ]: s = s + x + y x = 6 for y in [ 7, 8 ]: s = s + x + y s = 0 x = 5 y = 7 s = s + x + y y = 8 s = s + x + y x = 6 y = 7 s = s + x + y y = 8 s = s + x + y

Making a speed conversion chart mph->kph – Chart the conversion: 10, 30, 40, 60, 75, 100mph – Print out example: 10mph kph Now try it using one for loop! Much more concise!

Numbers: 1, 2, 4, 8, 10, 20, 40, 80, 100, 200, 400, 800, 1000 Import - To not reinvent the wheel! - Use the console to check usage quickly!

Don’t forget colon Careful about the indentation

Command line environment Print Loop