SyntaxError: invalid syntax with Chicken coop door script
<p>I am new to python, I have been trying to get a piece of code working to control a chicken coop door.
The github link is <a href="https://github.com/ryanrdetzel/CoopControl" rel="nofollow">https://github.com/ryanrdetzel/CoopControl</a></p>

<p>The problem I have is that if I run server.py it does not get the MAILGUN_KEY variable from the coop.conf file. So I tried running start.sh I get SyntaxError: invalid syntax error, but I can not see for the life of me what can be wrong.</p>

<p>This is the start.sh file</p>

<p><code>sudo MAILGUN_KEY = 'key-c5e6aa4561a7077e8c0fc55e594cf26' MAILGUN_URL = 'https://api.mailgun.net/v3/sandboxc1ea9c71ab95485dac75b03cc5dd5883.mailgun.org/messages' MAILGUN_RECIPIENT = 'google@google.org' python server.py</code></p>

<p>The Syntax error is under the <code>Y</code> of <code>MAILGUN_KEY</code>, I am running python verson 3. I don't know if that would make a difference. </p>

<p>Can anyone see the problem?</p>

<p>You are mixing up shell script syntax and Python syntax. Your problem is not at all related to Python.</p>

<p>To set environment variables for single invocation of binary, correct form is:</p>

<pre class="lang-sh prettyprint-override"><code>ENV1=VAL1 ENV2=VAL2 /path/to/bin some args
</code></pre>

<p>So in your case it would be:</p>

<pre class="lang-sh prettyprint-override"><code>MAILGUN_KEY=key-c5e6aa4561a7077e8c0fc55e594cf26 MAILGUN_URL=https://api.mailgun.net/v3/sandboxc1ea9c71ab95485dac75b03cc5dd5883.mailgun.org/messages MAILGUN_RECIPIENT=google@google.org sudo python server.py
</code></pre>

python syntax-error sh