New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Software Engineering Tools Laboratory

by: Cassidy Casper

Software Engineering Tools Laboratory ECE 36400

Cassidy Casper
GPA 3.59


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Electrical Engineering & Computer Science

This 5 page Class Notes was uploaded by Cassidy Casper on Saturday September 19, 2015. The Class Notes belongs to ECE 36400 at Purdue University taught by Staff in Fall. Since its upload, it has received 48 views. For similar materials see /class/207906/ece-36400-purdue-university in Electrical Engineering & Computer Science at Purdue University.

Similar to ECE 36400 at Purdue

Popular in Electrical Engineering & Computer Science


Reviews for Software Engineering Tools Laboratory


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/19/15
ECE 354 Snnware Tnnls Laboratory Lecture 7 February 23 2008 Lecture 07 r Cumpansun hetweeh pythuh aha KumShell Reminders I Praetreal Exam 1rs m twu weeks Ht Wt eaver hum atenalup tn the rheruarug thrs reeture Leeture 7 39Na externalmatena rs an m he prawded wrth banks the reeture nates Optmnal Help Sessmn next week 39Regrade requests 39Cheatmg Sample programs cepres ufthe pmgrams cuvered m thrs class can he fuund m the fulluwmg arreetury mamee wammaee ALEOXX hr sawLEOXX where xxrs the reeture humher seemteem f r nstance Tod ay39s le cture Ishmetrmes Ilters easxer Semetrmes Pytheh rs easxer Chnnsing the right tnnl can he the must impnrtznt thing anI dn The praetrear has bath KSH aha pythuh Thrs wru help yuu prepare Command line parameters e Kornshell m the warmers st m Eremsme rs m Iu w e I W gt U H I HI 11 pmquot mayhem 1 1 shm Command line parameters Python import sys print Number of parameters 1ensysargvl print Executable name is sysargv0 I 0 for I in rangel lensysargv print quotParameter d s I sysargvI Examples 39 Let s take a look at the programs lParametersksh lParameterspy Permissions KornShell FilenamequotSomeFi1eNamequot if r Fi1ename 1 then print n quotFile Fi1enamequot print quot is not readablequot fi Permissions Python import 05 Filename quotSomeFi1eNamequot if osaccessFilename osROK 1 print File quot05 is not readablequot 9 Filename Examples 39 Let s take a look at the programs 2ReadStdinksh 2ReadStdinpy 39 These programs read from standard input and print to standard output but donWibrgetaboutrednec on 2ReadStdin ksh lt SomeFi1e 2ReadStdinpy lt SomeFile File IO KornShell while read A Line do while I lt Line do print I I LineI I done done lt SomeFi1e 39 Where s the bug Executing commands in F11e IO Python Python FH openquotSomeFilequot quotr quot I We haven39t really talked about how to execute external commands like gcc in Python for Llne 1n FH39 usrbinenv python 39 39 39 im ort s 5 Line L1nespllt wiggt gmmands 1 39 39 1 enssarv for I In rangelenLlne39 print Usa g sysargv0 quotCommand ltArgsgtquot u o o u o sysexi print I od 05 o I L1neI Comman Ij insyslargvll FH Close print quotRunning command quot Command 39 Status Outpu commandsgetstatusoutputCommand print quotStatus39 quot Status pPBtt39 utput 1 u pu 39 Where s the bug lprint Output e se print quotNo output generatedquot sysexit0 Compile a series of files 3Runpy ks h I Lg v Nm d f for File in c do t s run some comman s rom print quotCompiling Filer Python using 3Runpy rm f File95 c I 9 ansi Wall 0 oFile95c File 39 Note It runs commands under sh the if quotI10 I1 T ziFileg5CI 1II then Bourne Shell rather than under ksh Print 1 e39 M 1 a a1 e to mmpl e fi done 2gtamp1 Compile a series of files Exam es Python p 33Q ds 39 Let s take a look at the programs 39 4Compileksh CFiles commandsgetoutputquotls cquot split 4 Compilelpy for File in CFiles print quotCompilingquot File Xe Filereplacequotcquot quotquot ossystemquotrm f quotXec commandsgetstatusoutput Wall 0 oquot Xe quot quot File if Status 0 or osaccessExec 1 1 print quotFilequot File quotfailed to compilequot Ve lociraptors l quotIt39s a UNIX system Iknow this Program testing KornShell 39 What ifwe want to run a program w1th multlple mput es Xec C Xec ata 1h Input7 do prlht Ruhhlhg Xec wlth Data rm at core Xec lt Data 2gt 1 1f 7 e H at core 1 then print Flle Xec felled With Data t1 done 2gtamp1 Xec 7X for Data 1h Input do print Ruhhlhg Xec wlth Data rm at core OutputXec lt Data 2gtamp1 1f 7 0 H 7f core 1 then punt Flle Xec felled w1th Data t1 punt 0utput done 2gtamp1 Program testing Python lmpprt strlhg lmpprt cummahds 7aput dsgetuutput ls 1hputj spl1t InputiL cumma tpr Data 1h InputiLlst prlht Ru l g Xec ussystem rm rt cure Statue output cummahpsgetstatusputput Xec lt Data with Data usaccess cure 0 fallen with Data pr prlht Flle Xec prlht output Examples l Let39s take a look at the programs 5Test Programksh Menus KornShe ll Hunksh PSS Select a fund ltem select Item 1h Burger Fues Shake Qult pp prlht case REPLY 1n 1 print That W111 be 50000 LY 2 print That W111 be 1000 REPLY H 3 print That W111 be B000 REPLY H vpu made the rlght chulce lht Invalm entry REPLY Menus Python usrbinenv python impor sys ItemsquotBurgerquot quotFriesquot quotShakequot quotQuitquot eply None while Reply None prin for I in range print quotd print quotSelect a food ite Rep y sysstdinreadlinestrip t 1 lenItems1 squot II ItemsI1 m quot ry Reply intReply except ValueError rin print quotInvalid entryquot Reply None else print if Reply lt e or Reply gt lenItems print quotInvalid entryquot Reply pa sysexit0 Examples 39 One last little fun script 10Trapksh elif Reply 1 print quotThat will be 5000 one y 2 print quotThat will be 1000 None y 3 print quotThat will be 8000 eply None se print quotYou made the right choicequot 55 Examples 39 Let s take a look at the programs 9Menuksh 9Menupy Assignment for Lab 8 39 Do the prelab it willbe worth 5 points out of your final lab score 39 Bring up idle and work through all ofthe examples covered during lecture 39 Check out the commands module in Beazley ifyou need to 39 Read Rosenberg ifyou need to


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.