有沒有辦法為 Android 或 IOS 創建一個 dash-plotly 應用程序?我已經閱讀了一些Beeware文檔,但我仍然不知道如何獲取我的儀表板并將其包含到 app.py 默認文件中:import togafrom toga.style import Packfrom toga.style.pack import COLUMN, ROWclass Matics(toga.App): def startup(self): """ Construct and show the Toga application. Usually, you would add your application to a main content box. We then create a main window (with a name matching the app), and show the main window. """ main_box = toga.Box() self.main_window = toga.MainWindow(title=self.formal_name) self.main_window.content = main_box self.main_window.show()def main(): return Matics()他們提供的示例是一個 Hello world 應用程序,其代碼如下:class HelloWorld(toga.App): def startup(self): main_box = toga.Box(style=Pack(direction=COLUMN)) name_label = toga.Label( 'Your name: ', style=Pack(padding=(0, 5)) ) self.name_input = toga.TextInput(style=Pack(flex=1)) name_box = toga.Box(style=Pack(direction=ROW, padding=5)) name_box.add(name_label) name_box.add(self.name_input) button = toga.Button( 'Say Hello!', on_press=self.say_hello, style=Pack(padding=5) ) main_box.add(name_box) main_box.add(button) self.main_window = toga.MainWindow(title=self.formal_name) self.main_window.content = main_box self.main_window.show() def say_hello(self, widget): print("Hello", self.name_input.value)我還沒有找到一種方法將破折號圖代碼包含在 main_box 中。我的目標是將儀表板作為 Android 的 APK,所以如果 beeware 不是解決方案,我會很高興看到解決方案是什么。
1 回答

互換的青春
TA貢獻1797條經驗 獲得超6個贊
要將公文包代碼部署到 apk 中,首先在項目目錄中打開命令提示符,然后在命令窗口中鍵入:
briefcase create android
完成所有工作后,然后鍵入:
briefcase build android
然后需要幾分鐘的時間,然后你的 apk 將被創建,并為此創建一個 iOS 應用程序,你需要和 Mac PC 和命令是相同的,但你必須用 iOS 替換 android .. 謝謝
添加回答
舉報
0/150
提交
取消