Miscellaneous task solved in Python 2.7.6. Shell