filename = None
-(options, args) = getopt.getopt(sys.argv[1:], "f:", "file=")
+try:
+ (options, args) = getopt.getopt(sys.argv[1:], "f:", "file=")
+except getopt.GetoptError, err:
+ print str(err)
+ sys.exit(2)
for option in options:
if option[0] == "-f" or option[0] == "--file":
parts = line.split()
question_number = int(parts[0])
clue = " ".join(parts[1:])
- crossword["across"][int(question_number)] = clue.encode('utf-8')
+ crossword["across"][int(question_number)] = clue.encode(code)
if indown:
if line != "":
parts = line.split()
question_number = int(parts[0])
clue = " ".join(parts[1:])
- crossword["down"][int(question_number)] = clue.encode('utf-8')
+ crossword["down"][int(question_number)] = clue.encode(code)
num_cols = len(crossword["grid"][0])
num_rows = len(crossword["grid"])