Just print each field like this
print("StructType([") for field in df.schema.fields: print("\t" + str(field)) print("])")
And then copy the output.