怎麼這裏是我到目前爲止有:我需要改變郵政編碼爲一系列的點和線(條形碼),但我想不出
def encodeFive(zip):
zero = "||:::"
one = ":::||"
two = "::|:|"
three = "::||:"
four = ":|::|"
five = ":|:|:"
six = ":||::"
seven = "|:::|"
eight = "|::|:"
nine = "|:|::"
codeList = [zero,one,two,three,four,five,six,seven,eight,nine]
allCodes = zero+one+two+three+four+five+six+seven+eight+nine
code = ""
digits = str(zip)
for i in digits:
code = code + i
return code
有了這個,我」會得到一個字符串中的原始郵政編碼,但是沒有一個數字會被編碼到條碼中。我已經想出瞭如何編碼一個數字,但它不會以五個數字相同的方式工作。
您是否考慮過簡單地使用其中一種可用的條形碼字體呢? – 2010-05-09 18:59:41