![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
github.com/tc-hib/winres
Package winres provides functions for embedding resources in a Windows executable built with Go.
Most often, you'll want to embed an application icon, a manifest, and "version information", which is what you can see in the Details tab of file properties.
If you are looking for a command line tool, please head to go-winres.
This project is similar to akavel/rsrc and josephspurrier/goversioninfo.
This is not a real resource compiler, which means it won't help you embed these UI definitions:
ACCELERATORS
DIALOGEX
MENUEX
POPUP
If you ever need them, which is unlikely, use one of those tools instead:
rc.exe
and cvtres.exe
from Visual Studiowindres
from GNU Binary Utilitiesllvm-rc
and llvm-cvtres
from LLVM toolsSee Resource Compiler for more information.
To embed resources, you need an .rsrc
section in your executable. Winres provides functions to compile this .rsrc
section into a COFF object file.
Put this file in your project directory, name it "something.syso" or, preferably,
"something_windows_amd64.syso", and you're done :
the go build
command will detect it and automatically use it.
You should have a look at the command line tool to try it. Using the library gives you more control, though.
Here is a quick example:
package main
import (
"io/ioutil"
"os"
"github.com/tc-hib/winres"
)
func main() {
// Start by creating an empty resource set
rs := winres.ResourceSet{}
// Add resources
// This is a cursor named ID(1)
cursorData, _ := ioutil.ReadFile("cursor.cur")
rs.Set(winres.RT_CURSOR, winres.ID(1), 0, cursorData)
// This is a custom data type, translated in english (0x409) and french (0x40C)
// You can find more language IDs by searching for LCID
rs.Set(winres.Name("CUSTOM"), winres.Name("COOLDATA"), 0x409, []byte("Hello World"))
rs.Set(winres.Name("CUSTOM"), winres.Name("COOLDATA"), 0x40C, []byte("Bonjour Monde"))
// Compile to a COFF object file
// It is recommended to use the target suffix "_window_amd64"
// so that `go build` knows when not to include it.
out, _ := os.Create("rsrc_windows_amd64.syso")
rs.WriteObject(out, winres.ArchAMD64)
}
Many thanks to akavel for his help.
This project uses these very helpful libs:
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.