Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Right click context menu of a file in Python

import sys
import subprocess

def main():
    if len(sys.argv) == 1:
        path = sys.argv[0]
        subprocess.run(['/path/to/my.exe', path])
    else:
        print('Usage myscript.py <path>')

if __name__ == "__main__":
    main()
Comment

PREVIOUS NEXT
Code Example
Python :: python selenium geolocation 
Python :: rotate x labels in plots, matplotlib 
Python :: python run another python script 
Python :: create a response object in python 
Python :: numpy distance between two points 
Python :: godot 2d movement 
Python :: selenium send keys python 
Python :: python pickle save and load multiple variables 
Python :: cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4. 
Python :: tag for deleting a list in python 
Python :: how to give multiple option to the user and ask the same question again and again until the user tells one of the options 
Python :: how to install django in virtual environment in ubuntu 
Python :: matplotlib multiple plots with different size 
Python :: pandas add a column with loc 
Python :: function to convert minutes to hours and minutes python 
Python :: pandas column to numpy array 
Python :: python nameerror input 
Python :: remove too short strings from a list python 
Python :: pandas normalize groupby 
Python :: python open dicom file 
Python :: get number of bits for integer in python 
Python :: Get value from TextCtrl wxpython 
Python :: matplotlib title not fully visible 
Python :: numpy add axis 
Python :: ax set xtick size 
Python :: iterate over every alternate character in string python 
Python :: send email with python 
Python :: virtual env 
Python :: python launch file 
Python :: unzip python 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =