On Jan 14, 2016, at 8:53 PM, Matthew Allen <memecode at gmail.com> wrote:
> 
>    p = subprocess.Popen(["sqlite3.exe", "Database.sqlite"],
> stdout=subprocess.PIPE)

It looks like you?re trying to use both stdin and stdout, but you really only 
need stdout here, since sqlite3.exe will accept SQL or sqlite3 shell commands 
on its command line after the database argument.  You don?t need to feed it the 
commands over stdin.

In fact, you don?t even need to use stdout, if you?re willing to leave it all 
to the command shell:

   cmd.exe /c sqlite3 Database.sqlite .dump | sqlite3 NewDatabase.sqlite

Then replace Database.sqlite with NewDatabase.sqlite, optionally moving the 
former to a backup location first.

Reply via email to