0

Windows app not working as it did when run from IDE

I am looking to allow the user to select excel files and then evaluate basic information from the file. It works fine in the app that opens from running in the IDE (JupyterLab) but after packaging as a windows app I ran it and it won't complete properly. I suspect some kind of error is being thrown but can't figure out how to get that information once it's packaged as an app. I tried to follow the documentation for handling errors and printing them but adapting to flet:

try:

    def main(page: Page):

            # Save file dialog
            def save_file_result(e: FilePickerResultEvent):
                save_file_path.value = e.path if e.path else "Cancelled!"
                save_file_path.update()

            save_file_dialog = FilePicker(on_result=save_file_result)
            save_file_path = Text()

            # hide all dialogs in overlay
            page.overlay.extend([save_file_dialog])

            page.add(

                    Row(
                        [
                            ElevatedButton(
                                "Pick files",
                                icon=icons.UPLOAD_FILE,
                                on_click=lambda _: save_file_dialog.save_file(),
                                disabled=page.web,
                            ),
                            save_file_path,

                        ]
                    ),
                )

            def button_clicked(e):
                #my code which evaluates the excel file using pandas

            calculate = ElevatedButton("Calculate Usability Ratio", on_click=button_clicked, data=0)
            t = Text()

            page.add(calculate, t)

    flet.app(target=main)
    
except Exception as err:
    def error(page: Page):
    
        page.add(
                Text(f"Unexpected {err=}, {type(err)=}"),
        )
    flet.app(target=error)
    raise


0 Answers0