Lab 10 FAQ

General Recommendations | Debugging Advice | SocialNetwork class | InstaFace program

General Recommendations

Debugging Advice

SocialNetwork

Reading in the People File.
When you read in from a file, what does every line end with? How will that affect your code? Anything you should fix?

To test that your method worked, you could display the social network. To test programmatically, you'll probably just test with methods that deal with the userids. We can't handle comparing Person objects well at this time. However, after we have covered __eq__, you could override that method to make testing programmatically with Person objects easier.

Reading in the Connections File.
We solved a similar problem in terms of reading in this file format in class when we read in the file with the format name year on each line.
Exporting People.
What is the format of the people file that you read in? That is what you want to write out in this method. Note that this method takes the filename, where as the helper method takes the file object.
Do I need to implement _writePersonToFile?
No, not necessarily. It could be helpful to you to break down the writing a person to a file from writing all the people to the file.

If you choose to implement the method, pay careful attention to the parameters to the method, which is different from our typical parameters dealing with files.

InstaFace

Command-line Arguments. Look at the example code from the lab slides. You may want to copy the program into IDLE. To test the command-line arguments, you need to run the program from the terminal. The idea is to make testing the program easier with a variety of files used as inputs (without having to retype the filenames). I've done most of the hard work. Just read the comments for what you need to do.

Recommendations: