무엇이 문제입니까? (그리고 나는 단지 초보자, 너무 복잡 아무것도주십시오 해요!) 두 번째 f.write(red)
라인 후들여 쓰기 문제! (Python 2.7)
#!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
, 그것은 붉은 분홍빛이 도는 하이라이트를 보여주고 말한다 :
'내어 쓰기가 일치하지 않습니다 바깥 쪽 들여 쓰기 레벨 '
이것은 무엇을 의미하며 어떻게 도와 줄 수 있습니까?
대단히 감사합니다!