title: How to print the schema of a dataframe with Python objects rather than Java objects?
body: <p>For example:</p>
  <pre><code>df = spark.read.json(&quot;path&quot;)
  print(df.schema)
  </code></pre>
  <p>prints:</p>
  <pre><code>StructType(List(StructField(timestamp,StringType,true)))
  </code></pre>
  <p>rather than:</p>
  <pre><code>StructType([StructField(&quot;timestamp&quot;,StringType(),True)])
  </code></pre>
  <p>This is an issue for me if i want to come up with a schema by initially inferring the schema from a file in order to then print the schema and hardcode it in my code.</p>
  <p>Is there a way to print the schema of a dataframe and have it in python syntax so that i can set a hardcoded schema to a variable in my code and use it?</p>