Thursday, September 28, 2006

Python note: module subprocess provides functionalities to open arbitrary file

To open an email attachment in some email client, the client needs to make new processes which opens the corresponding file. This can be done by using the subprocess module, which spawns new process and opens the file.

import subprocess
subprocess.Popen(filename, shell=True)

No comments: