Python Forum
How to format text to modify itself for different console sizes.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to format text to modify itself for different console sizes.
#1
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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to create a table with different sizes of columns in MS word pepe 8 1,412 Dec-08-2023, 07:31 PM
Last Post: Pedroski55
  Read text file, modify it then write back Pavel_47 5 1,499 Feb-18-2023, 02:49 PM
Last Post: deanhystad
  Printing effect sizes for variables in an anova eyavuz21 2 939 Feb-01-2023, 02:12 PM
Last Post: eyavuz21
  Output difference from 2 lists of different sizes with words gracenz 5 1,232 Sep-02-2022, 05:09 PM
Last Post: Larz60+
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,574 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Change Text Size in Console? ShakeyPakey 9 11,001 Dec-09-2021, 02:51 AM
Last Post: drvlwho
  [split] Change Text Size in Console? CodingKid 1 1,847 Jul-20-2021, 02:47 PM
Last Post: deanhystad
  Modify Input() text catosp 6 2,825 Jun-08-2020, 10:48 PM
Last Post: deanhystad
  converting data sizes like: 4k, 32k, 4m, 16m, 1g, etc Skaperen 1 2,146 Jul-16-2019, 01:37 AM
Last Post: Skaperen
  How best to format text in a simple text file? Pedroski55 2 3,135 Jun-14-2019, 06:07 AM
Last Post: noisefloor

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020