On Aug 23, 3:45 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > Lamonte Harris wrote: > > >> Basically you can open a file by double clicking, and by default it would > >> open > > w/ what every program you have it set >to. Most text files would open in > > notepad. How can I make a txt open so that notepad opens w/ the content in > > it > > by >using just python. > > > I asked this question just yesterday - and Tim Golden answered: > > > os.startfile() > > > - Hendrik > > Actually os.startfile('filename.txt') will open the file with whatever > application is associated with .txt files on that machine. That could be > different from notepad if the user has chosen to override the defaults. > > os.system('notepad.exe c:\\junk.txt') > > will force notepad.exe to load and it will load the file specified. > > All depends on what you want to do. > > -Larry
That's true, but technically you should use the subprocess.Popen module with Shell=True rather than the os.system method. At least, in the newer Python versions, that seems to be the recommendation. Mike -- http://mail.python.org/mailman/listinfo/python-list