这有什么问题?(而且我只是一个初学者,所以没什么复杂的,拜托!)
#!usr/bin/python
import os
import sys
import pdb
import time
import array
red = chr(00), chr(00), chr(255)
blue = chr(255), chr(00), chr(00)
print "Monochrome Bitmap Color Changer"
print "Supported colors: "
print "Black, White, Blue, Red, Yellow,"
print "Green, Orange, Purple, Pink, Brown, Grey"
print ""
filename = raw_input("Please enter filename or directory of monochrome bitmap: ")
whitevalue = raw_input("Change all white pixels to? ")
blackvalue = raw_input("Change all black pixels to? ")
with open (filename, 'r+b') as f:
f.seek(54)
if whitevalue is "red" or "Red":
f.write(red)
elif whitevalue is "blue" or "Blue":
f.write(blue)
f.seek(58)
if blackvalue is "red" or "Red":
f.write(red)
elif blackvalue is "blue" or "Blue":
f.write(blue)
exit
#print "Done"
#time.sleep(3)
#exit
在第二f.write(red)
行之后,它显示了一个淡红色的高光并显示:
'unindent 不匹配任何外部缩进级别'
这是什么意思,如何帮助/解决它?
非常感谢!