Due to the fact that now Pandas doesn't have the to_fwt function, I've found a solution that should solve this problem:
from tabulate import tabulate
def to_fwf(df, fname):
content = tabulate(df.values.tolist(), list(df.columns), tablefmt="plain")
open(fname, "w").write(content)
pd.DataFrame.to_fwf = to_fwf
But it doesn't write a file in the fixed-width format as it was declared. It seems to me that I should pass the colspecs parameter somehow. Any ideas here?