A Go program that wraps Python DLLs and scripts without CGo to make it stand-alone for Windows.
- 32bit Windows, Python 3.4.4 (To be in compatable with Windows XP)
- Which means if you're on 64bit Windows, you must set
$env:GOARCH = 386
on PowerShell orset GOARCH=386
on CMD beforego build
or change contents oflib
directory to 64 bit ones.
- Which means if you're on 64bit Windows, you must set
This can be easily modified by replacing files and directories like
python.exe
,pythonXY.dll
,msvcrXXX.dll
,lib
underbin
directory with any version of Python you want. They're usually in Python installation directory or%WINDIR%\System32\
.
- Instantly runnable Go & Python program packages without asking user to setup Python before.
- Multiple Python interpreters running seperately by Go routines
- Go program that uses python script as user-friendly script
- Build with
go build
. - Put built
GoPythonDLLWrapper.exe
inbin
directory to let it get along with other dependent files. - Just think built
GoPythonDLLWrapper.exe
as the same aspython.exe
. Which means you can just./GoPythonDLLWrapper
to open python REPL or./GoPythonDLLWrapper main.py hello
to runmain.py
script with argumenthello
in PowerShell. (or justGoPythonDLLWrapper
andGoPythonDLLWrapper main.py hello
in CMD) - Feel free to modify
main.go
on your need. (Related docs) You can also renameGoPythonDLLWrapper.exe
to anything you want. - There's a batch file named
main.bat
inbin
directory which redirects all additional arguments to another binary pointed byCMD
. You can easily make shortcuts with this batch file in case of having multiple startpoint scripts for your project.
While everyone thinks it's able to, doing so is entirely burdened on the person who is awaken to.