.
Open a file with its own program
Python has a simple method for opening a file with its default program. It goes something like this:
import os
os.startfile(path)
Yes, it’s that easy, if you’re on Windows. If you’re on Unix or Mac, you’ll need the subprocess module or “os.system”. Of course, if you’re a real geek, then you probably have multiple programs that you might want to use to open a specific file. For example, I might want to edit my JPEG file with Picasa, Paint Shop Pro, Lightroom, Paint.NET or a plethora of other programs, but I don’t want to change my default JPEG editing program. How do we solve this with Python? We use Python’s subprocess module! Note: If you want to go old school, you can also use os.popen* or os.system, but subprocess is supposed to supersede them.
Βασικά αυτό που δεν ξέρω είναι πώς πρέπει να γράψω τη γενική μορφή ενός αρχείου .txt, ώστε να ανοίγει κάθε αρχείο .txt