Hi, I have a pbm file that reads the 0's and 1's. And I have to convert it to a text file. In a pbm file, the 0's and 1's are printed left to right. But I need to convert it to a list and make it print up and down for the text file. I keep getting a syntax error when I append/insert the input to the list. Could someone help me fix this bug?
#outputting the 217 file
if sys.argv[1] == "217":
SENTINEL = "END"
current_checksum = 0
print("Assignment 3 output")
print("i")
print("image")
print(width, height)
pbm = []
while True:
try:
print(pbm)
pbm.insert(pbm)
pbm.split()
except EoFError:
#checksum
checksum = int(input())
if checksum != current_checksum:
print("Incorrect checksum")