Assignment 9: Python and Julia

Author

Matthew DeHaven

Due

April 10, 2024

Modified

April 2, 2024

1 Setup Python

2 Setup Julia

3 Accept Assignment on Github Classroom

  1. Accept Assignment 9 on Github Classroom.

  2. Clone this assignment to your computer.

3.1 Python Task

  • Create a virtual environment for this repository

  • Install the package matplotlib

  • Run “python-example.py”

This should create a “python-example.pdf” with a boring chart as an output.

  • Preserve your environment by runnning the following in the terminal:
terminal
pip freeze > requirements.txt

This command saves all of the package versions in your venv to a simple text file, requirements.txt. You (or others) can use requirements.txt to recreate the environment by running pip install -r requirements.txt.

3.2 Julia Task

In the same repository folder,

  • Create a Julia environment for this repository

    • Make sure to link your VS Code workspace to the environment
  • Install the package Plots.jl 1

  • Run “julia-example.py”

1 Julia always referes to packages as “Example”.jl, when you actuall install them, you just use add Example, without the ‘jl’ extension.

This should create a “julia-example.pdf” with a sine chart as an output.

3.3 Push to Github

You should make sure to commit and push the following new files to Github:

  • requirements.txt
  • python-example.pdf
  • Manifest.toml
  • Project.toml
  • julia-example.pdf

You do not need to commit either:

  • .vscode
  • .venv (this should have a gitignore by default)