Python Forum

Full Version: How to format text to modify itself for different console sizes.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i'm making a program and for what it would be the help command i need to display info about each command. The thing is that the text is too long and depending on the CMD window size it will be displayed badly.

"""All the functions used in the main.py file are defined here"""

integer_command = "Tells the program that you want to work with Integers," \
    " you will then be asked to enter the what kind of numbers you want" \
    " to generate, even, odd or both, then you will be asked for the" \
    " quantity of numbers you want to" \
    " generate, the minimum number that can be generated and the" \
    " maximum number that can be generated."


def show_commands():
    """Shows the list of commands available."""
    print("The commands are: ")
    print("<integer>: " + integer_command)


show_commands()
Thats the text I need to show, but i want it to be always formatted in this way:
Output:
<integer>: TEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERE

wait this post wasnt ready :C

Output:
<integer>: TEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERE TEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERETEXTHERE
That is how i want i t to be no matter the cmd window size.

Thanks!