UnhappyJumpySenegalpython

# This is some bullshit code Nickflame20 wrote. Do whatever you want with it.
Ipx = ["i", "!", ",", ".", "|", ";", ":"]
IIpx = ["l", "'", "`"]
IIIpx = ["t","I", "[", "]", ]
IVpx = ["f","k", '"', "(", ")", "*", "<", ">", "{", "}"]
Vpx = ["a", "b", "c", "d", "e",  "g", "h", "j", "m", "n", "o", "p", "q", "r", "s", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "#", "$", "%", "&", "+", "-", "/", "?", "\\", "^", "_"]
VIpx = ["@", "~"]

def toPx(char):
        if char in Ipx:
                return(1)
        elif char in IIpx:
                return(2)
        elif char in IIIpx:
                return(3)
        elif char in IVpx:
                return(4)
        elif char in Vpx:
                return(5)
        elif char in VIpx:
                return(6)
        else:
                return(5)
print("""This is Nickflame20's tool for centering text in books. Input a line of text and hit enter. The first line is the number of spaces to pad the text with, the second line is a string of the spaces, and the third line is your string padded with the proper spaces.

This tool is not always perfect and may require sleight editing by a human.
""")
while True:
        pixels = -1
        string = str(input("String: "))
        
        for i in string:
                pixels = pixels + toPx(i) + 1
        spaces = ((116 - pixels) / 2) / 5
        print(round(float(spaces)))
        out = ""
        while spaces > 0:
                out = out + " "
                spaces = spaces - 1
        print(out)
        print(out + string)