Hi there, I would like users of my web application to be able to download a backup file of a database (using* *MySQL's *mysqldump* command).
My strategy is to use *zipfile* to create a zip file object (with the * mysqldump* output as the contents of the zipped file) and then use * sys.stdout* to send the zip file object to the user as a file for them download. The zipping bit and file delivery is all sorted. Getting the output from * mysqldump* is my problem and I'm not even sure (given that I'm calling shell via an HTTP thread/process) it is even possible. This is as far as I've got: import subprocess as sp p1 = sp.Popen('mysqldump --opt --user=[username]--password=[password] [databasename]',stdout=sp.PIPE,shell=True) backupfile=p1.communicate()[0] If I type the above into a Python prompt and print *backupfile* I will get the expected result, but when I'm going through CGI nothing is being returned by communicate(). Is this possible? Or am I barking up the wrong tree? Cheers, Brendon
-- http://mail.python.org/mailman/listinfo/python-list