Skip to content

Instantly share code, notes, and snippets.

Last active Oct 29, 2020
What would you like to do?
Call your Python Script from your Autohotkey automation script and pass arguments to it as well
import argparse
# GET Arguments using command line
parser = argparse.ArgumentParser(description='For my visitors!')
parser.add_argument("--argument_to_be_passed", required=True, type=str, help="Please pass a value into --argument_to_be_passed")
args = parser.parse_args()
value = args.argument_to_be_passed
; Autoexecute
#SingleInstance force
run cmd.exe
WinWait, ahk_exe cmd.exe ; Intention to make sure the next line doesn't execute too soon and not hit CMD (I have not checked for an appropriate WinTitle. But you can definitely get it.)
Send c:{enter} ; Go to C drive
Send cd C:\python\blog\{enter} ; go to script's folder
Send python --argument_to_be_passed CODEONION{enter}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment