Python app building

Tagged: ,

Viewing 5 reply threads
  • Author
    Posts
    • #57861
      moncef_el
      Participant

      whenever I build my app cx_Freeze I doesn’t succeed. Actually there’s no error in the app or in the building but when clicking on the executable app it just show a black cmd box for 1s and close without showing anything else.
      Are there any suggestions?

    • #57869
      Andrew
      Keymaster

      Did you pronounce loudly “Sim-salabim, freeze!” before the build? No? Too bad as other magicians here will not be able to look remotely over your shoulder on your build environment.

      Seriously, what kind of answer do you expect with such information?

      Try to run samples and demos from SDK on your machine, are they working at all?

    • #57870
      moncef_el
      Participant

      XD
      I made already an app which work with no problem but I really don’t know how to convert those 10 files into an exe file. It’s not only Python files; there are htm files for sure and py file then other stuff(xls,db).
      I took about 2 months learning and practicing tiscript with html&css&python and I really want to know how to bring this program into real world!
      Thanks

    • #57871
      Andrew
      Keymaster

      I made already an app which work with no problem but I really don’t know how to convert those 10 files

      Yeah, that’s better.

      As far as I understand cx_Freeze supports not just .py packaging but so called data files too.

      HTML/CSS/scripts and others can be treated as such data files:
      https://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files

      In order Sciter to load such files from “cx bundle” you need to override on_load_data method and fetch requested resources from the bundle.

    • #57872
      moncef_el
      Participant

      Alright, things start to be clear for me XD, but as I understood: I must include before my

      if __name__ == '__main__':
          import os
          htm = os.path.join(os.path.dirname(__file__), 'index.htm')
          frame = Frame()
          frame.load_file(htm)
          frame.run_app()

      this:

      def on_load_data(self, nm: SCN_LOAD_DATA):
              """Notifies that Sciter is about to download a referred resource."""
              pass

      and that I’ve got nothing to do with on_data_loadedand on_attach_behavior

      • #57873
        Andrew
        Keymaster

        No idea of what is the Frame there…

        But if it is some class that derived from class Window then it is already a sciter host window and so that

        def on_load_data(self, nm: SCN_LOAD_DATA):
                """Notifies that Sciter is about to download a referred resource."""
                pass

        has to be declared as a method of that frame overriding sciter.host.Host.on_load_data

    • #57874
      moncef_el
      Participant

      Thanks, I tried some steps I found on the net across your idea and it works fine; I actually manage to create an MSI based on all the file using a tool called HM NIS EDIT, so helpful
      Thanks again for your support

Viewing 5 reply threads
  • You must be logged in to reply to this topic.