{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 03: Solutions to Useful standard library modules exercises" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "from pathlib import Path\n", "import shutil\n", "import subprocess\n", "import sys\n", "import zipfile" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise: Make a script with a command line argument using sys.argv\n", "\n", "1) Using a text editor such as VSCode, make a new ``*.py`` file with the following contents:\n", "\n", "```python\n", "import sys\n", "\n", "if len(sys.argv) > 1:\n", " for argument in sys.argv[1:]:\n", " print(argument)\n", "else:\n", " print(\"usage is: python