Hi Mike,<br><br>If calling 'os.system(txtfile)' is not sufficient, in Windows you can trek through the registry.<br><br>First HKEY_CLASSES_ROOT\.txt which points you to the 'txtfile' entry.<br>Then HKEY_CLASSES_ROOT\txtfile\shell\open\command<br>
the value on my system is:<br>%SystemRoot%\system32\NOTEPAD.EXE %1<br><br>I don't know what you need to do on other platforms, perhaps look at the code for os.system?<br><br>Hmm, I just tried that via Cygwin:<br>>>> import os<br>
>>> <a href="http://os.name">os.name</a><br>'posix'<br>>>> os.system('file.txt')<br>sh: file.txt: command not found<br>32512<br>>>><br><br>So maybe that's not as helpful as I thought.<br>
<br>Cheers,<br>Eric<br><br>On 21 February 2011 17:31, Mike Dewhirst <span dir="ltr"><<a href="mailto:miked@dewhirst.com.au">miked@dewhirst.com.au</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I want to launch the system text editor with a known text file but I don't know what that editor might be on which platform.<br>
<br>
Is there a Python library which can discover the system text editor on any platform?<br>
<br>
TIA<br>
<br>
Mike<br>
<br>
_______________________________________________<br>
python-au maillist - <a href="mailto:python-au@starship.python.net" target="_blank">python-au@starship.python.net</a><br>
<a href="http://starship.python.net/mailman/listinfo/python-au" target="_blank">http://starship.python.net/mailman/listinfo/python-au</a><br>
</blockquote></div><br>