#This provides desired format, but only works with one variable at a time np.savetxt("test2.txt", list(zip(shared_A_B)), fmt=\'%.18s\',delimiter=\'\\t\') #