title: Creating packet using struct.pack with python
body: <p>I want to create a packet using python. The packet have 4 fields, each of 32-bits. I have the sample code:</p>
  
  <pre><code>import socket, sys, os, struct
  field1 = 1
  field2 = '255.255.255.0'
  field3 = 20
  field4 = '192.168.0.1'
  
  struct.pack=('!L4sL4s',field1,field2,field3)
  </code></pre>
  
  <p>But I have no output. How can I format this packet so I can have exactly 4 bytes for each variable.</p>