Unformatted text preview:

6.081, Spring Semester, 2007—Work for Week 1 1MASSACHVSETTS INSTITVTE OF TECHNOLOGYDepartment of Electrical Engineering and Computer Science6.081—Introduction to EECS ISpring Semester, 2007Work for Week 1This handout contains:• Software Lab for Tuesday, February 6• Pre-Lab exercises due Thursday, February 8 at 2PM; you should come and do them in lab onWednesday, February 7. This week: Everyone should come and bring their laptop, ifthey have one. We’ll have a software installation party.• Robot Lab for Thursday, February 8• Post-lab exercises due Tuesday, February 13 at 2PMAll pre- and post-lab exercises are to be handed in individually. Please see the collaboration policyon the web site for more information.Getting startedSchedule In general, the weekly schedule for 6.081 will be like this:• Tuesday lecture from 2–3:30, followed by a software lab from 3:30 - 5:00. We will also hand outthe homework for the coming week. The homework will include a part that is due on Thursdaybefore lab and a part that is due the following Tuesday before lecture. The homework willhave parts to write up and turn in, as well as parts to be done with the online tutor.• Wednesday evening homework help session from 6–10. Attendance at these sessions is stronglyrecommended. You are welcome to do the homework for Thursday on your own if you prefer,or in a self-organized study group. But we suggest that your time will be much better spentif you do your pre-lab homework in the staffed Wednesday sessions. When programming,especially, it’s easy to get lost in rat-holes and spend enormous amounts of time diggingyourself out. Doing your work when there are staff members around can make things mucheasier.• Thursday afternoon lab. Each lab will end with a short quiz based on the pre-lab assignmentas well as the material covered during the lab.• Post-lab homework, due before the following Tuesday lecture.Reading This is such a cool new way of looking at the material of intro EECS, there is notextbook. We will be producing draft notes each week, and those will be your primary readingresource. In addition, for Python, we recommend finding a basic language reference that you likeand also reading How to Think Like a Computer Scientist.• Official Python tutorial: http://http://docs.python.org/tut/tut.html6.081, Spring Semester, 2007—Work for Week 1 2• How to Think Like a Computer Scientist: Learning with Python, by Allen Downey, JeffreyElkner, Chris Meyers. This book assumes no programming experience. It is not a Pythonreference manual; it is a computer science text that uses Python as an example. Highly recom-mended. http://www.greenteapress.com/thinkpython/thinkCSpy.pdf• Learning Python, by David Ascher and Mark Lutz. This book also assumes very little/no pro-gramming experience, and is longer (not so great for learning Python in a hurry, but coverstopics in great detail, so is good as a reference guide if you know what you’re looking for).http://proquest.safaribooksonline.com.libproxy.mit.edu/0596002815?tocview=true (Youneed an MIT Certificate to view this one)• Learn Python in 10 Minutes, by Poromenos. If you have very little time and a fair bit ofprogramming experience in another language, this tutorial covers Python’s syntax quickly.http://www.poromenos.org/tutorials/python• Look at some of the other reference material on the class web site under “Resource Material”(under the “General Information” menu at the top of the web page).1Software LabStarting and using IDLEIDLE is a simple way to edit and run Python programs. To start it on one of the lab laptops, goto a shell and type> idle-python2.4Python Shell The Python shell acts a little bit like a calculator. You type in expressions, Pythonevaluates them, and then prints the result. So, if you type>>> 4 + 4It will print out 8. Play with the shell a little bit.Edit a file You’ll want to use the shell to test things out, but not to write your programs. If youwant to start defining procedures, you should open a new file (choose New Window from the Filemenu) and write your definitions in there. So, start by making a file containing this definition:a = ’hi’b = 7def f(x):return x + 1Now, choose Run Module from IDLE’s Run menu. It will act as if you have typed the text of yourfile into the shell. If there was something obviously syntactically wrong with your file (parenthesesnot closed, for example), IDLE will tell you about it and highlight the point in your file where theproblem is. Otherwise, the shell will print out something like1If you use Windows with Internet Explorer as your web browser, you won’t see the drop-down menu under“General Information”. There’s a “Resource Material” link at the bottom of the home page that you can followinstead.6.081, Spring Semester, 2007—Work for Week 1 3>>> ================================ RESTART ================================>>>And now you can ask it to evaluate expressions, including things you’ve defined in your file.Question 1. Use the Python shell to compute f(f(f(b))).Question 2. What happens if you do f(a)?To do the following exercises, use the shell for experimentation, and write new procedure definitionsin your file. Whenever you change your file, you’ll need to do Run Module again.Archive your file When you do work on a lab laptop, you should always remember to mail orFTP your files back to yourselves. We don’t guarantee that you’ll always get the same laptop orthat any files that you leave on it will remain there from week to week.An easy way to keep your files safe is to use a webmail service. You may have a service such asGmail or Hotmail before. We’ll explain the process using MIT webmail.To use MIT webmail, first, you go to: http:\\webmail.mit.edu. To log in, type your Athena ac-count user name and its password. You can compose an email to your email address ([email protected],where user is your account name), and attach your files.Another way to protect your files is to copy the files from a lab laptop to your Athena account.You can do this by using the scp command. General usage of scp (when copying the file to theremote computer) is as follows.file user@machine:fileFor example, if you want to copy the file lab1.py to the directory Courses/6.081 on your Athenaaccount user1, you type:scp lab1.py [email protected]:Courses/6.081/lab1.pyNote that the directory specified in the destination (Courses/6.081) must have been created


View Full Document

MIT 6 01 - Introduction to EECS I

Documents in this Course
Week 1

Week 1

3 pages

Op-Amps

Op-Amps

8 pages

Op-Amps

Op-Amps

6 pages

Syllabus

Syllabus

14 pages

Planning

Planning

14 pages

Load more
Download Introduction to EECS I
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to EECS I and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to EECS I 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?