| 1 |
|
| 2 |
""" |
| 3 |
This example shows how to make a shortcut that runs a single python command |
| 4 |
|
| 5 |
Here, the comand to run is |
| 6 |
python -m pip install --upgrade pyshortcuts |
| 7 |
|
| 8 |
to update to the latest version of this library. |
| 9 |
|
| 10 |
|
| 11 |
Note that putting '_' or '{}' as the beginning of the command will tell |
| 12 |
the script to use the current Python executable. |
| 13 |
""" |
| 14 |
from pathlib import Path |
| 15 |
from pyshortcuts import make_shortcut, uname, get_cwd |
| 16 |
|
| 17 |
pycmd = "_ -m pip install --upgrade pyshortcuts" |
| 18 |
|
| 19 |
iconfile = 'shovel.icns' if uname=='darwin' else 'shovel.ico' |
| 20 |
icon = Path(get_cwd(), 'icons', iconfile).absolute().as_posix() |
| 21 |
|
| 22 |
make_shortcut(pycmd, name='Update Pyshortcuts', icon=icon) |