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 = 386on PowerShell orset GOARCH=386on CMD beforego buildor change contents oflibdirectory 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,libunderbindirectory 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.exeinbindirectory to let it get along with other dependent files. - Just think built
GoPythonDLLWrapper.exeas the same aspython.exe. Which means you can just./GoPythonDLLWrapperto open python REPL or./GoPythonDLLWrapper main.py helloto runmain.pyscript with argumenthelloin PowerShell. (or justGoPythonDLLWrapperandGoPythonDLLWrapper main.py helloin CMD) - Feel free to modify
main.goon your need. (Related docs) You can also renameGoPythonDLLWrapper.exeto anything you want. - There's a batch file named
main.batinbindirectory 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.