result = '[' + "\n ".join([" ".join(["%6g" % val for val in line]) for line in array]) + ']'
EDIT: using generator comprehensions rather than list comprehensions for greater efficiency (thanks, Mike):
result = '[' + "\n ".join(" ".join("%6g" % val for val in line) for line in array) + ']'
0 comments:
Post a Comment