Two columns
Given the two columns will never have more than 24 characters, you can use for example:
for user, pwd in myresult:
print('{: <20} {}'.format(user, pwd))
Or if that is not known in advance, we can first determine the maximum size of the first column:
len_user = max(map(lambda x: len(str(x[0])), myresult))
for user, pwd in myresult:
print('{} {}'.format(str(user).ljust(len_user), pwd))
For the sample data, this then yields:
>>> len_user = max(map(lambda x: len(str(x[0])), myresult))
>>> for user, pwd in myresult:
... print('{} {}'.format(str(user).ljust(len_user), pwd))
...
None A***9****
None None
usertest pwtest
You can add more spacing between the two {}
s in the formatting to increase the spacing between the elements, for example:
>>> for user, pwd in myresult:
... print('{} {}'.format(str(user).ljust(len_user), pwd))
...
None A***9****
None None
usertest pwtest
Multiple columns
For multiple columns, we can follow the same procedure, and use numpy to calculate the columnwise maximum:
import numpy as np
lens = np.max([[len(str(xi)) for xi in x] for x in myresult], axis=0)
myformat = ' '.join(['{}']*len(lens))
for col in myresult:
print(myformat.format(*map(str.ljust, map(str, col), lens)))