HW 4: Python primer
- Due Jan 31 by 9am
- Points 1
- Submitting a website url
Install Python 3.11 or higher if you don't already have it installed; you'll also need an editor, like Visual Studio code. Here's a video I made for a different class that walks you through the process Links to an external site..
Watch this overview of Python Links to an external site.. If you haven't used Python before, here are some resources to help you pick it up:
- Learn Python Links to an external site. (learnpython.org)
- Python tutorial Links to an external site. (python.org)
- Python glossary Links to an external site. (python.org)
- Python builtins Links to an external site. (python.org)
To test that you have Python installed correctly and to get your feet wet if your new to Python, write a program called apache_first_col.py in the scripts/ directory of your repository that will open an apache log, and for each line in that file, output just the first whitespace delimited column (which should be the IP address). You can hardcode it to read in the first unzipped log file from our apache dataset, hank.feild.org-access.log (you'll probably have a file path like, '../data/apache-logs/hank.feild.org-access.log').
Make sure that script is committed in you course git repository and pushed to GitHub (if you are not using the command line interface for Git, you should be able to add files directly in GitHub). Submit a link to your script on GitHub.