File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import osproc, os, strformat
2+
3+ # ================================
4+ # HARD-CODED EXECUTABLE PATH
5+ # ================================
6+ when defined (windows):
7+ const exePath = r " C:\Programs\PythonVirtualEnv\tuivirtual\Scripts\python.exe " # Change to your executable
8+ else :
9+ const exePath = " /home/you/yourprogram" # Change for Linux/macOS
10+
11+ # ================================
12+ # MAIN
13+ # ================================
14+
15+ when isMainModule :
16+ # Collect optional arguments from command line
17+ var args: seq [string ] = @ []
18+ for i in 1 .. paramCount ():
19+ args.add (paramStr (i))
20+
21+ # Run the executable with arguments
22+ echo fmt" Running executable: { exePath} with args: { args} "
23+ let process = startProcess (exePath, args= args, options= {poParentStreams})
24+
25+ # Wait for it to finish
26+ discard process.waitForExit ()
27+ echo " Process finished."
You can’t perform that action at this time.
0 commit comments