flexxui / flexx

Write desktop and web apps in pure Python
http://flexx.readthedocs.io
BSD 2-Clause "Simplified" License
3.26k stars 257 forks source link

pyinstaller package operation problem #675

Open liaoshengyong opened 4 years ago

liaoshengyong commented 4 years ago

After flexx is packaged, it can only be run through Firefox or NW.js. If the user does not have Firefox or NW.js, the software will not run normally. I want to modify the Firefox browser in the running directory in the code to run Firefox in the specified directory. If it doesn't work, help me modify the following code to run it with pyqt.

from flexx import flx

class Example(flx.Widget):
    def init(self):
        flx.Button(text="Hi there")

if __name__ == "__main__":
    app = flx.App(Example)
    app.freeze("flexx_apps")
from flexx import flx
import sys

class Example(flx.Widget):

    def init(self):
        flx.Button(text='hello')
        flx.Button(text='world')
def main():
    app = flx.App(Example)
    app.launch("Chrome-app")
    flx.run()

if __name__ == "__main__":
    sys.exit(main())
almarklein commented 4 years ago

You should be able to bring your own copy of Firefox or nw.js. Have a look at the webruntime package. Though I think its easier to simply eask your users to install Firefox.

Note that you can also do app.launch("firefox-app or chrome-app")