What tools exist to recover a file I clobbered using cpp in terminal?
Here are a few options to recover a file from user error of this type:


TimeMachine - your best hope. 
Dropbox also keeps deleted files and versions if you stored that file in a folder that synced. 
mdfind MYSCRIPT.py #better than locate and searches inside files, not just file names
Check your repositories if you use code control software like git or mercurial or svn or other tools
General undelete software like Data Rescue


As you're now aware, the terminal is unforgiving and doesn't have an "are you sure you meant to clobber that file?" design mentality. It gets worse when you realize recursive commands and the fact that everything is a file (directories, disks, disk images, etc...) and errant commands can delete vast amounts of work in the blink of an eye.