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
  [split] Change Text Size in Console? CodingKid 1 536 Jul-20-2021, 02:47 PM
Last Post: deanhystad
  Modify Input() text catosp 6 1,187 Jun-08-2020, 10:48 PM
Last Post: deanhystad
  Change Text Size in Console? ShakeyPakey 8 5,083 Jun-03-2020, 08:48 AM
Last Post: buran
  converting data sizes like: 4k, 32k, 4m, 16m, 1g, etc Skaperen 1 1,020 Jul-16-2019, 01:37 AM
Last Post: Skaperen
  How best to format text in a simple text file? Pedroski55 2 1,910 Jun-14-2019, 06:07 AM
Last Post: noisefloor
  Save console output to text file (like a log) koticphreak 9 17,254 Jun-02-2019, 07:45 PM
Last Post: snippsat
  write image into string format into text file venkat18 2 2,331 Jun-01-2019, 06:46 AM
Last Post: venkat18
  Format text and variables - more lines dan789 3 1,440 Jan-08-2019, 03:07 PM
Last Post: buran
  Stream Data to Text or CSV format ekq378 0 1,389 Nov-16-2018, 06:32 PM
Last Post: ekq378
  Convert text file date into specific format jacklee26 11 6,171 May-15-2018, 07:36 AM
Last Post: buran

Forum Jump:

User Panel Messages

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