Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

os.startfile on raspberry

import os, sys, subprocess

def open_file(filename):
    if sys.platform == "win32":
        os.startfile(filename)
    else:
        opener = "open" if sys.platform == "darwin" else "xdg-open"
        subprocess.run([opener, filename])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #raspberry
ADD COMMENT
Topic
Name
6+4 =