Ejemplo n.º 1
0
def characterize(first='Jane',
                 last='Doe',
                 gender='Female',
                 archetype=arch.standard):
    '''Generate a fictional character based on user arguments.'''

    my_char = Character(first, last, gender, archetype)  # Create a character.
    my_char.sample_traits(archetype)  # Sample some personality traits.
    my_char.export_markdown()  # Serialize character sheet in Markdown.
Ejemplo n.º 2
0
def characterize(first='Jane',
                 last='Doe',
                 gender='Female',
                 filename='character.txt',
                 archetype=arch.standard):
    """Generate a fictional character based on user arguments.

    Parameters
    ----------
    first : str
        The first name of the character.
    last : str
        The last name of the character.
    gender : str
        The gender of the character.
    filename : str
        Path of the text file to export character info.
    archetype : archetype
        Type of archetype (standard or antagonist).

    Returns
    -------
    .txt
        Outputs a character.txt file with the character info.

    """

    f = open(filename, 'w')
    my_char = Character(first, last, gender, archetype)  # Create a character.
    my_char.sample_traits(archetype)  # Sample some personality traits.
    f.write(my_char.export_markdown())  # Serialize character sheet Markdown.
    f.close()