Physics > Lab Report > Lab 9a1 Rotational Inertia and Energy in Rotational Motion - New Jersey Institute Of Technology PHYS (All)
CP104 Lab 10: Files Week of 2021-03-28 Instructions To attend the lab, locate the Zoom lab session link available at CP104 course MyLearningSpace page under "Zoom Lab sessions". Listen to Instruct... or instructions. Create a PyDev project named login_ln (where n is the lab number) and put all of your lab task material in this project. Put your name, ID, and Laurier email address in the comments section of all PyDev modules. Test all your tasks with both the online testing and your own, and copy your test results to the file testing.txt. You have to complete 5 of the listed tasks, each one worth 2 marks, for a total of 10 marks. The lab instructor will tell you which 5 tasks to complete at the beginning of the lab. Ask a lab IA in your respective breakout room to mark your lab tasks before you leave the Zoom meeting. Export your marked and completed PyDev project to a archive file named login_ln.zip (where n is the lab number). Get a copy of the archive file, import it into your workspace, and rename the project with your login. Upload your completed PyDev project to the appropriate dropbox in MyLearningSpace. If you have problems creating, exporting, or renaming PyDev projects, follow the instructions in Using Eclipse with PyDev tutorial. Documentation Guideline Syntax definitions are surrounded by a solid-line box Sample Python code and output are surrounded by a dashed-line box Python code is preceded by a right angle-bracket '>' (Do not type in the '>' as part of your programs). The results of executing code have nothing in front of them. Sample keyboard input is underlined, as in: Enter a number: 34.5 For these tasks you will work with three files: customers.txt, numbers.txt and words.txt. customers.txt contains the following data: 12345,Tom,Black,300.00,1998-01-30 23456,Alice,Smith,1200.50,1998-02-20 14567,Jane,White,900.00,1998-07-01 43564,Weilin,Zhao,450.25,1998-01-03 45432,Bina,Mehta,278.95,1998-03-21 There are five customers in the file: 'Tom Black' is the first customer, 'Bina Mehta' is the last customer. There are five fields for each customer: ID, first name, last name, account balance, and account opening date in ISO YYYY-MM-DD format. numbers.txt and words.txt each contains a number/word on each line, respectively. Put all functions into a common PyDev library module named functions.py. Test these functions by calling them from separate PyDev modules. For each task, work with the file contents directly. Do Not simply copy the contents of the file into a list and work with that. This is particularly inefficient when searching a file handle - if the file has 10,000 lines, and what you are looking for is on the second line, then reading the entire contents of the file into a list is completely unnecessary. 1. Implement the following function in the PyDev module functions.py and test it from a PyDev module named t01.py: Work with the customers.txt file in this question. def customer_record(fh, n): """ ------------------------------------------------------- Find the n-th record in a comma-delimited sequential file. Records are numbered starting with 0. Use: result = customer_record(fh, n) ------------------------------------------------------- Parameters: fh - file to search (file handle - already open for reading) n - the number of [Show More]
Last updated: 2 years ago
Preview 1 out of 14 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Nov 26, 2022
Number of pages
14
Written in
This document has been written for:
Uploaded
Nov 26, 2022
Downloads
0
Views
138
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·