title: SyntaxError: missing ; before statement - Python
body: <p>Let's say I have this snippet</p>
  <pre><code>list_command = 'mongo --host {host} --port {port} ' \
               '--username {username} --password {password} --authenticationDatabase {database} &lt; {path}'
  
  
  def shell_exec(cmd: str):
      import subprocess
      p = subprocess.call(cmd, shell=True)
      return p
  </code></pre>
  <p>Let's say these are the commands I'm trying to run on mongo</p>
  <pre><code>use users
  show collections
  db.base.find().pretty()
  </code></pre>
  <p>If format the string <strong>list_command</strong> with the appropriate values and pass it to the function with <strong>shell=True</strong>, it works fine. But I'm trying to avoid it for security purposes.
  If I call it with <strong>shell=False</strong>, I get the following error:</p>
  <blockquote>
  <p>2020-08-31T14:08:49.291+0100 E QUERY    [thread1] SyntaxError: missing ; before statement @./mongo/user-01-09-2020:1:4
  failed to load: ./mongo/user-01-09-2020
  253</p>
  </blockquote>