Trying to open a file separately from bge with python

Hello, I’m trying to open a file using whatever the computer has set for the given file extension separately outside the BGE from a python script within the game engine. I’m not very good with python so I don’t really know what i’m doing. Please help if you can.

Edit: ok so i came acrossed this thread earlier:

And this persons was doing basically the same thing but their script worked unlike mine. But I noticed they were using the same lines I was trying to.


And then I also noticed they were using 2.63 and I was using 2.79(the last ver. before UPbge, I’m not acquainted in it yet)

So in short: either import os or os.startfile doesn’t work in the newer ver. I was running, and 2.79 has a later version of python.
Does anyone know what the updated equivalent of using import os and then os.startfile() in python is? because I guess I’m stuck in an older version until someone helps me figure it out.
Thanks for any help in advance, cheers.