On Friday, June 08, 2007, at 02:57PM, "Kent Johnson" <[EMAIL PROTECTED]> wrote:
>has wrote:
>> Anyway, simplest solution here is:
>> 
>>      import subprocess
>>      subprocess.call(['open', '/Users/drew/Documents'])
>
>or
>import open
import os # ;-)
>os.system('open /Users/drew/Documents')

That works but is non-trivial to get entirely correct due to quoting. Using 
subprocess is much better because you don't have to worry about quoting for the 
shell.  Os.popen and os.system should basically be deprecated, but that will 
probably not happen anytime soon because they are used a lot in existing code.

Ronald

>
>Kent
>_______________________________________________
>Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>http://mail.python.org/mailman/listinfo/pythonmac-sig
>
>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to