title: Export MySQL database to sql file with Python os.system
body: <p>I want to export a database to sql file with Python, so I tried this</p>
  
  <pre><code>import os
  os.system('mysqldump -u root -p database &gt; database.sql')
  </code></pre>
  
  <p>and it asks me to write the password of the root user in the shell, but I'm doing a GUI application, so I don't want the user to interact with the shell.</p>
  
  <p>Is it possible to give it the password in some other way?</p>