tkhm / pyoxidizer-trial

PyOxidizer Trial Repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyOxidizer Trial

PyOxidizer sample.

Prerequisite: Setup with Getting Started — PyOxidizer 0.1 documentation

Structure

  • pyoxi

    Generated by pyoxidizer init pyoxi. It includes the most important configuration file pyoxidizer.toml

  • pyproj

    Python project. mymain.py is entry point and model.progress is called by mymain.py.

    Here is the execution command example: python mymain.py -m "something"

    It will print "something" and <model.progress.ProgressRate object at 0x10ef7c780> or like that.

Build and Run executable binary

Working directory is pyoxi.

  1. Build: pyoxidizer build
  2. Run: build/build/apps/pyapp/debug/pyapp -m "something"

You can find executable in here: Release First Executable · tkhm/pyoxidizer-trial

Note

  • Import numpy lib will be failed with the following error:

    Traceback (most recent call last):
        File "mymain", line 5, in <module>
        File "numpy", line 126, in <module>
        File "numpy.__config__", line 10, in <module>
    NameError: name '__file__' is not defined
    SystemError
    

    You can reproduce it with adding numpy==1.16.3 in requirements.txt + adding from numpy import polyfit and polyfit([1], [1], 1)[0] in mymain.py or somewhere.

  • Rebuild will not execute

    If you just change your python code, pyoxidizer build will not build again. I guess you need to update pyoxidizer.toml's timestamp.

    You can do that with touch pyoxidizer.toml.

About

PyOxidizer Trial Repo


Languages

Language:Rust 98.9%Language:Python 1.1%