On Fri, 2013-05-10 at 17:14 +0800, Sudheer Joseph wrote: > Thank you, > But I was looking for a format statement likw > write(*,"(A,5F8.3)") > with best regards, > Sudheer
How about the following: print('IL = ' + (('%d,' * 5)[:-1] + '\n ') * 5 % tuple(IL)) If instead of a list IL you had some arbitrary 2D array, a, you could do (with 2 lines for clarity): print_string = 'a = ' + (('%d,' * a.shape[1])[:-1] + '\n ') * a.shape[0] % tuple(a.T.ravel()) print(print_string) I'll leave it as an exercise for you to put that into a file. hen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion