{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5a3f09e7-6178-4c0d-b9e0-379357e894b3",
   "metadata": {},
   "source": [
    "### Homework 4 assignment.\n",
    "#### Python scripts.\n",
    "\n",
    "Download an archive and find header files.\n",
    "\n",
    "By using jupyter notebook, develop a python script to accomplish the tasks below. Please use only the following python modules:\n",
    "```subprocess```, ```glob```, ```os```, ```shutil```, and ```zipfile```.\n",
    "\n",
    "A)\n",
    "- Download the ```tar.gz``` file for application ```gv-3.7.4``` from ```https://ftp.gnu.org/gnu/gv``` url in directory Python.\n",
    "- Extract the archive.\n",
    "- Remove file ```gv-3.7.4.tar.gz``` if it exists, so the procedure can be re-runnable.\n",
    "\n",
    "B)\n",
    "- In directory ```gv-3.7.4```, recursively find all files with extension ```.h``` and copy them into new directory ```H_files```.\n",
    "- Zip directory ```H_files``` with its content into file ```h.zip```\n",
    "- Remove directory ```H_files``` with its content.\n",
    "\n",
    "C) Create executable python script ```download_gv.py``` that includes the tasks in A and B above.\n",
    "\n",
    "Unzip file ```h.zip``` in the command line to verify the directory contains the ```.h``` files.\n",
    "\n",
    "#### Provide the URL and the application name in the command line.\n",
    "\n",
    "Develop a modified version of the script, ```download_any.py```, that takes the url and the application name as arguments in the command line with ```--url```, and ```--app``` by using python module ```argparse```.\n",
    "\n",
    "Run the script for the following urls and apps:\n",
    "\n",
    "- 'https://ftp.gnu.org/pub/gnu/gnats'    'gnats-4.2.0'\n",
    "- 'http://ftp.gnu.org/pub/gnu/gperf'     'gperf-3.3'\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
