answered 10 years ago
Rename your file to my.sage
Then, when you run sage my.sage it will be automatically preparsed. A my.py with all the needed extra python code will be produced and loaded automatically.