py

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

`py` package provides functions for working with Python.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PipInstall

func PipInstall(dep string)

Install dependencies using uv pip

func PipUninstall

func PipUninstall(dep string)

Uninstall dependencies using uv pip

func ReinstallPyEnv added in v0.2.6

func ReinstallPyEnv() error

reinstall the Python environment

func RunCode

func RunCode(code string) map[string]any

Run the Python code and return the result.

func RunCodef

func RunCodef(codeTemplate string, args ...any) map[string]any

Run the Python code with the given Golang variables and return the result. The codeTemplate should use $v1, $v2, etc. placeholders for variable substitution.

func RunFile added in v0.1.5

func RunFile(filePath string) map[string]any

Run the Python file and return the result.

func RunFilef added in v0.1.5

func RunFilef(filePath string, args ...any) map[string]any

Run the Python file with the given Golang variables and return the result. The codeTemplate should use fmt.Sprintf style formatting (e.g., %q, %d, %v).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL