Put the essential code of calc_weights.py into a function learn_weights, which takes a MegaTableau.  calc_weights can now be imported; calling it from the command line will cause it to call learn_weights automatically and print the learned weights to the terminal in a nice format.