Python code file prototype

John Gordon gordon at
Fri Feb 17 17:20:37 CET 2012

In <66ea0353-02ee-4152-947a-97b44ff3ec45 at> Bruce Eckel <lists.eckel at> writes:

> There's an option when you do this to insert default file contents, so
> I began searching the web for some kind of prototype Python file that
> would be appropriate to start with. I'm certain I've seen this before
> and that there's been discussions about the best starting point for a
> python code file, but I find I can't get any search hits for it.

Here's what PyScripter inserts in a new python file:

  # Name:        module1
  # Purpose:
  # Author:      $USERNAME
  # Created:     $DATE
  # Copyright:   (c) $USERNAME $YEAR
  # Licence:     <your licence>
  #!/usr/bin/env python

  def main():

  if __name__ == '__main__':

Where $USERNAME, $DATE and $YEAR are expanded to the actual values.

John Gordon                   A is for Amy, who fell down the stairs
gordon at              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

More information about the Python-list mailing list