(filename="turtle_docstringdict")
Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
Create and write docstring-dictionary to file.
Create and write docstring - dictionary to file .
def write_docstringdict(filename="turtle_docstringdict"):
    """Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    """
    docsdict = {}

    for methodname in _tg_screen_functions:
        key = "_Screen."+methodname
        docsdict[key] = eval(key).__doc__
    for methodname in _tg_turtle_functions:
        key = "Turtle."+methodname
        docsdict[key] = eval(key).__doc__

    with open("%s.py" % filename,"w") as f:
        keys = sorted(x for x in docsdict
                      if x.split('.')[1] not in _alias_list)
        f.write('docsdict = {\n\n')
        for key in keys[:-1]:
            f.write('%s :\n' % repr(key))
            f.write('        """%s\n""",\n\n' % docsdict[key])
        key = keys[-1]
        f.write('%s :\n' % repr(key))
        f.write('        """%s\n"""\n\n' % docsdict[key])
        f.write("}\n")
        f.close()
def write_docstringdict ( filename = "turtle_docstringdict" ) : docsdict = { } for methodname in _tg_screen_functions : key = "_Screen." + methodname docsdict [ key ] = eval ( key ) . __doc__ for methodname in _tg_turtle_functions : key = "Turtle." + methodname docsdict [ key ] = eval ( key ) . __doc__ with open ( "%s.py" % filename , "w" ) as f : keys = sorted ( x for x in docsdict if x . split ( '.' ) [ 1 ] not in _alias_list ) f . write ( 'docsdict = {\n\n' ) for key in keys [ : - 1 ] : f . write ( '%s :\n' % repr ( key ) ) f . write ( '        """%s\n""",\n\n' % docsdict [ key ] ) key = keys [ - 1 ] f . write ( '%s :\n' % repr ( key ) ) f . write ( '        """%s\n"""\n\n' % docsdict [ key ] ) f . write ( "}\n" ) f . close ( )