system calls that interact with OSX finder
am 27.09.2009 00:43:51 von Dan Yamins--001636eee1f57483bc047482cc1d
Content-Type: text/plain; charset=ISO-8859-1
I have an apache virtual host for some local development I'm doing using
python cgi scripts.
Here is a example script that should open a "Finder" window on the server if
the server is running OSX, and an explorer window if it's running windows or
cygwin.
-------
print 'Content-Type: text/html\n\n'
import os
import platform
if (platform.platform().startswith('Darwin') or platform.mac_ver()[0] !=
''):
os.system('open .')
elif platform.platform().startswith('Windows') or
platform.platform().startswith('CYGWIN'):
os.system('explorer .')
-------
This script works when run manually, e.g. not through Apache. It also works
on Windows and CYGWIN. Also it used to work on OSX before I updated to
from OS 10.5.6 to 10.5.7.
Now, however it doesn't work on OSX. Nothing happens when I load the page.
Similarly this script should open a text editor window if the server is OSX:
-------
print 'Content-Type: text/html\n\n'
import os
import platform
if (platform.platform().startswith('Darwin') or platform.mac_ver()[0] !=
''):
os.system('edit myfile.txt')
-------
It also used to work, but it also no longer does.
If anyone can give me a clue as to what might be happening that would be
great.
Thanks!
Dan
--001636eee1f57483bc047482cc1d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I have an apache virtual host for some local development I'm doing usin=
g python cgi scripts.
Here is a example script that should open a &q=
uot;Finder" window on the server if the server is running OSX, and an =
explorer window if it's running windows or cygwin.
-------
print 'Content-Type: text/html\n\n'
import os
=
import platform
if (platform.platform().startswith('Darwin')=
or platform.mac_ver()[0] !=3D ''):
os.system('=
open .')
elif platform.platform().startswith('Windows') or platform.platform=
().startswith('CYGWIN'):
os.system('explorer .&=
#39;)
-------
This script works when run manually, e.g. not t=
hrough Apache.=A0 It also works on Windows and CYGWIN. =A0 Also it used to =
work on OSX before I updated to from OS 10.5.6 to 10.5.7.
Now, however it doesn't work on OSX.=A0 Nothing happens when I load the=
page.
Similarly this script should open a text editor window if=
the server is OSX:
-------
print 'Content-Type: text/html\n\=
n'
import os
import platform
if (platform.platform().startswith('Darwin') or platform.mac_ver()[=
0] !=3D ''):
os.system('edit myfile.txt')
-------
It also used to work, but it also no longer does.
If anyo=
ne can give me a clue as to what might be happening that would be great.
r>
Thanks!
Dan
--001636eee1f57483bc047482cc1d--