Skip to content

Instantly share code, notes, and snippets.

@metasyn
Created October 6, 2018 19:48
Show Gist options
  • Save metasyn/b4ce9b42abe1600fb800817541b5d874 to your computer and use it in GitHub Desktop.
Save metasyn/b4ce9b42abe1600fb800817541b5d874 to your computer and use it in GitHub Desktop.
import osproc, logging, strutils, strformat
const defaultLog = "/tmp/nim-entrypoint.log"
when isMainModule:
addHandler(newFileLogger(defaultLog, fmtStr = verboseFmtStr))
info("Inside a nim process!")
let
programPath = "/opt/python/bin/python"
filePath = "reflector.py"
cmd = join(@[programPath, filePath], sep=" ")
info(fmt"Setting up: {cmd}")
info("Starting External Process...")
let success = execCmd(command=cmd)
if success != 0:
info(fmt"Non-zero exit code: {success}")
info("Exiting from nim...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment