r/learnpython • u/impshum x != y % z • May 07 '20
Handy Python Functions For All
A small collection of snippets that I use quite frequently. Feel free to use them for whatever you want. Go crazy!
Lonk: https://recycledrobot.co.uk/words/?handy_python_functions
1.0k
Upvotes
1
u/__xor__ May 08 '20 edited May 08 '20
your
notifyone that uses osascript allows for applescript injection, whether you useos.systemor evensubprocess.If someone passes in a title like
foo"\nset volume output muted TRUE\nquit app "Chrome, it can run arbitrary applescript. If usingos.system, you can literally just do command injection and run arbitrary shell commands.