![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.
gopkg.in/mjibson/esc.v0
esc embeds files into go programs and provides http.FileSystem interfaces to them.
It adds all named files or files recursively under named directories at the path specified. The output file provides an http.FileSystem interface with zero dependencies on packages outside the standard library.
go get -u github.com/mjibson/esc
esc [flag] [name ...]
The flags are:
-o=""
output filename, defaults to stdout
-pkg="main"
package name of output file, defaults to main
-prefix=""
strip given prefix from filenames
-ignore=""
regular expression for files to ignore
-include=""
regular expression for files to include
-modtime=""
Unix timestamp to override as modification time for all files
-private
unexport functions by prefixing them with esc, e.g. FS -> escFS
-no-compress
do not compress files
After producing an output file, the assets may be accessed with the FS() function, which takes a flag to use local assets instead (for local development).
esc can be invoked by go generate:
//go:generate esc -o static.go -pkg server static
Embedded assets can be served with HTTP using the http.FileServer. Assuming you have a directory structure similar to the following:
.
├── main.go
└── static
├── css
│ └── style.css
└── index.html
Where main.go contains:
package main
import (
"log"
"net/http"
)
func main() {
// FS() is created by esc and returns a http.Filesystem.
http.Handle("/static/", http.FileServer(FS(false)))
log.Fatal(http.ListenAndServe(":8080", nil))
}
esc -o static.go static
go run main.go static.go
You can see worked example in example dir
just run it as
go run example/main.go example/static.go
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.