Python to receive huge string as argument from rabbitmq
<p>On Raspberry 3 I run a Rabbit-Mq listener.py that receives a large string (json) consisting of 14000 key/value pairs. The listener.py script will grab this string and pass it along to another script(database.py) that will encode it back to json(python dict object), parse it and store the values to a Mariadb database.</p>

<p>The listener.py calls:</p>

<pre><code>os.system("python %s %s" % (database.py, body))
</code></pre>

<p>where "body" is the string received from rabbitmq. </p>

<p>I have a concern that the 14000 objects json might be to big to pass to database.py as <code>sys argument</code>. Are there any other methods I could achieve my goal? I just heard about pickle, is it better for my purpose?  </p>

<p>A simple way would be to use multiprocessing.connection with its <a href="https://docs.python.org/3/library/multiprocessing.html?highlight=multiprocessing#module-multiprocessing.connection" rel="nofollow">Listener and Client</a>. These methods use pickle internally.</p>

python json rabbitmq pickle