#!/usr/bin/env python3
"""
    This program will make a shell Python program with a timeetamp.

    Directions:
        Place this file in your ~/bin directory and put that in your PATH.
        Usage:
        
        $python makePy.py test

        produces the file test.py
"""
import sys
import os.path
import datetime
name = sys.argv[1] if len(sys.argv) == 2 else "id10t"
fullName = name + ".py"
if os.path.exists(fullName):
    reply = input("File exists; do you want to clobber it (y/n)? ")
    if reply != "y":
        sys.exit("Bailing")

with  open(name + ".py", "w") as fp:
    today = datetime.date.today()
    fp.write(
    f"""#    Author: Morrison
#   Date:  {today}
#   Program {name}.py
def main():
    print('I exist, therefore I am.')
if __name__ == '__main__':
    main()
"""
)
