Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Project 5 – Project Summarizer

Microproject

Write a Python program which takes a single argument — a directory name. Your program will, for every file in the directory, count the number of lines in that file using the Unix command wc. Then, write to the console each file name and its number of lines.

Main Project

Write a Python program that collects, summarizes, and shares with me all the programming assignments for this course.

You should begin by organizing your assignments in a folder structure which will make this easier. I recommend something like:

  • csc344
    • a1
    • a2
    • a3
    • a4
    • a5

Assuming the programs are in subdirectories a1, a2, …, a5 of directory csc344, your program should:

  • create a summary_ai.html (replacing i with the assignment number) file for each ai, which contains (in reasonably formatted, valid HTML):
    • the name of each source file (linked to the file itself), along with the number of lines long the file is, and
    • an alphabetized list of all identifiers used in the program (class, function, rule, variable etc. names), omitting duplicates. You do NOT need to specially filter keywords or builtin functions. Even though something like “for” in C isn’t really an identifier, we’ll be OK with including it. We won’t be OK with including punctuation which isn’t part of names, nor will we be ok with commented text. And don’t just delete all of your comments – you need to handle them!
  • create a valid HTML web page in the csc344 directory called index.html with links to each of the summary files;
  • create a tar.gz file containing all assignment sources, but excluding non-sources (executables, .class files, etc). Also included should be the html files created above. Be sure the links in the webpages are relative and work after extraction (and will work for me!);
  • upload the tar.gz file to google drive;
  • prompt the user for an email address and share the tar.gz file, sending a notification to the email you are sharing with.

A successful demo will involve running your program, us getting the shared file, downloading and extracting it, and being able to view your pages/code following the links on your page.

If you Haven’t Finished Every Project…

That’s OK! You can still do this one. If you’ve finished projects, you must use your source code as submitted. If you haven’t, use the following:

Dev Environment / Useful Resources

PyCharm
Regular Expressions in Python
Regular Expression Debugger / Tester
Google Drive API Python Quickstart