Homework 5#
Python scripting#
Repead exercises 2A and 2B from the midterm exam in directory Python, where you are running jupyter notebook.
A) Develop a python script that looks for files *.h, *.json, and *.cmake in directory DEB and copies them into
new directory HED. Use only modules shutil, os, and glob.
B) Modify the script in A by adding module configparser and reading the files from file look.ini
C) Modify the original script in A to use module json and read the files from file look.json
D) Create an executable python script based on the original one in A and use module argparse to read the files from the command line.
Code compilation and Makefile#
In new directory HW5, copy/paste the source code from Simple Linear Regression Example link below into
file reg.c:
Simple Linear Regression example
You also need to install package libgsl-dev on the VD.
A) Compile source code into executable reg.x and run the executable.
B) In the same directory, create a Makefile with targets:
reg.xtarget
cleanto remove the compilation products.