title: Send integers through python data socket with fixed size
body: <p>I've been trying to send some integer values over socket to a LabVIEW client using <code>json.dumps</code> but as the numbers change the size of each field may change, I would like to know if there is a way to pad the number with '0' without turning it into a string when I do the json dump, as it adds <code>" "</code> to the packet send around each number.</p>
  
  <p>Example:</p>
  
  <pre><code>data = json.dumps({"Data": str(52).zfill(4)]})
  self.sock.send(data.encode())
  </code></pre>
  
  <p>This sends </p>
  
  <pre><code>'"Data":"0052"'
  </code></pre>
  
  <p>I want</p>
  
  <pre><code>'"Data": 0052'
  </code></pre>