Python Forum
Python random formatting issues
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python random formatting issues
#1
Hello all -

Im occasionally running into a problem where Python will just ignore a formatting command, but the work fine on similar elements.

For example this part of the code is taking multiple lists and pretty printing them:
Delivery_Type = [
        "CMR - Construction Management at Risk",
        "DBB - Design Bid Build",
        "DB - Design Build",
        "MP - Multi-Prime",
        "IPD - Integrated Project Delivery,"]

Fee_Type = 
        "HOURLY",
        "HOURLY NTE",
        "FIXED FEE",
        "PERCENTAGE",
        "INVESTMENT",
        "PRO_BONO"]

print("""
Time to look at the Project Delivery Method.
Please choose from one of these: """)
    pp.pprint(Delivery_Type)
    Project_Delievery = input("What is the Project Delivery Type?: ").upper()
  

    print("""
Let's look at the FEE structure now.
Please choose from one of these: """)
    pp.pprint(Fee_Type)
    Fee = input("What type of Fee will this project be?: ").upper()
It runs fine except only one out of the several similar list wont print pretty, they all have the same formatting the same syntax the only thing different are the words used.

Time to look at the Project Delivery Method.
Please choose from one of these: 
[    'CMR - Construction Management at Risk',
     'DBB - Design Bid Build',
     'DB - Design Build',
     'MP - Multi-Prime',
     'IPD - Integrated Project Delivery,']
What is the Project Delivery Type?: a

Let's look at the FEE structure now.
Please choose from one of these: 
['HOURLY', 'HOURLY NTE', 'FIXED FEE', 'PERCENTAGE', 'INVESTMENT', 'PRO_BONO']
What type of Fee will this project be?: 
I have another instance were I try to run a ceiling format command and it works for all but one.
Reply


Messages In This Thread
Python random formatting issues - by Barnettch3 - Jan-24-2018, 06:05 PM
RE: Python random formatting issues - by Larz60+ - Jan-24-2018, 06:35 PM
RE: Python random formatting issues - by j.crater - Jan-24-2018, 06:54 PM
RE: Python random formatting issues - by j.crater - Jan-24-2018, 07:02 PM
RE: Python random formatting issues - by snippsat - Jan-24-2018, 09:33 PM
RE: Python random formatting issues - by Barnettch3 - Jan-28-2018, 09:03 PM
RE: Python random formatting issues - by Barnettch3 - Jan-28-2018, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  String formatting (strptime) issues Henrio 2 899 Jan-06-2023, 06:57 PM
Last Post: deanhystad
  python-docx: preserve formatting when printing lines Tmagpy 4 2,206 Jul-09-2022, 01:15 AM
Last Post: Tmagpy
Shocked Issues Installing Pyenv/Python 3.9.1 Brandon_Contactum 1 2,614 Feb-22-2022, 06:32 PM
Last Post: snippsat
  OpenPyXl formatting issues kpayney1 0 1,739 Nov-26-2021, 01:56 AM
Last Post: kpayney1
  Formatting issues? Mark17 1 1,748 Dec-30-2020, 04:17 PM
Last Post: Mark17
  Changing to new Python formatting example leodavinci1990 3 2,077 Sep-22-2020, 07:36 PM
Last Post: yaythomas
  TurtleWorld on MAC in Python 3.6 issues benniehanas 3 3,773 Jul-09-2018, 08:00 PM
Last Post: ichabod801
  Issues with Python script as service satishgunjal 8 7,619 Jun-21-2018, 11:40 AM
Last Post: satishgunjal
  python variable issues - using spyder and opencv Afrodizzyjack 5 5,880 Jun-19-2018, 09:46 AM
Last Post: gontajones
  issues while using Psexec from python code dev_devil_1983 0 3,612 May-28-2018, 07:55 AM
Last Post: dev_devil_1983

Forum Jump:

User Panel Messages

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