4 from optparse import OptionParser
11 opt_parser = OptionParser()
12 opt_parser.add_option('-q',dest='quiet',action='store_true',
13 default=False,help='suppress diagnostic output')
14 opt_parser.add_option('-7',dest='ascii',action='store_true',
15 default=False,help='use 7-bit output only')
16 opt_parser.add_option('-w',dest='width',action='store',type='int',
17 default=80,help='width for printing')
18 (options, args) = opt_parser.parse_args()
21 if (not options.ascii) and sys.stdout.encoding is None:
22 sys.stdout = codecs.open("/dev/stdout", "w", 'utf-8')
24 if not options.quiet: dbg_file(sys.stdout)
26 sympy.init_printing(use_unicode=(not options.ascii),
27 num_columns=options.width)