Refine Go runtime behavior and log handling
Some checks failed
build-windows-exe / build (push) Failing after 48s

This commit is contained in:
every_holiday
2026-06-24 01:53:24 +09:00
parent b34c2fafb4
commit 72aa10de46
10 changed files with 891 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
package app
import (
"fmt"
"log"
"os/exec"
)
func runPythonOcrFromScreen() error {
script := `
import sys
from pathlib import Path
root = Path(r"C:\Users\kenny\Documents\git\messpy\VRC\VRWT_Tool\VRC_OSC")
sys.path.insert(0, str(root / "src"))
from ocr.ocr_actions import runOcrFromScreen
runOcrFromScreen()
`
cmd := exec.Command("python", "-c", script)
cmd.Dir = `C:\Users\kenny\Documents\git\messpy\VRC\VRWT_Tool\VRC_OSC`
out, err := cmd.CombinedOutput()
if len(out) > 0 {
log.Printf("ocr output: %s", string(out))
}
if err != nil {
return fmt.Errorf("ocr failed: %w", err)
}
return nil
}