Search
 
SCRIPT & CODE EXAMPLE
 

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])
Comment

PREVIOUS NEXT
Code Example
Python :: customise django admin edit model button in field 
Python :: python ordering items in a list 
Python :: check is symmetric python 
Python :: download python for windows 7 32 bits 
Python :: print the list item dtype 
Python :: n largest python 
Python :: pandas sample frac 
Python :: random email generator python 
Python :: finding anagrams in python 
Python :: pandas merge validate 
Python :: vscode update imports python unresolved import 
Python :: convert pine script to python online 
Python :: how to get user input in python 
Python :: transpose of a matrix in python using loop 
Python :: download youtube video by python 
Python :: python label 
Python :: how to update a python package 
Python :: remove a columns in pandas 
Python :: select python interpreter vscode 
Python :: python libraries 
Python :: how to create multiple variables in a loop python 
Python :: How to perform heap sort, in Python? 
Python :: python selenium print xpath of element 
Python :: python get all numbers between two numbers 
Python :: show columns with nan pandas 
Python :: python rounding 
Python :: python call function by string 
Python :: python if elif else syntax 
Python :: partition python 
Python :: Convert .tif images files to .jpeg in python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =