久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='iTIEd'></bdo><ul id='iTIEd'></ul>

    <tfoot id='iTIEd'></tfoot>
  1. <legend id='iTIEd'><style id='iTIEd'><dir id='iTIEd'><q id='iTIEd'></q></dir></style></legend>

    <i id='iTIEd'><tr id='iTIEd'><dt id='iTIEd'><q id='iTIEd'><span id='iTIEd'><b id='iTIEd'><form id='iTIEd'><ins id='iTIEd'></ins><ul id='iTIEd'></ul><sub id='iTIEd'></sub></form><legend id='iTIEd'></legend><bdo id='iTIEd'><pre id='iTIEd'><center id='iTIEd'></center></pre></bdo></b><th id='iTIEd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iTIEd'><tfoot id='iTIEd'></tfoot><dl id='iTIEd'><fieldset id='iTIEd'></fieldset></dl></div>

    <small id='iTIEd'></small><noframes id='iTIEd'>

      同時(shí)運(yùn)行多個(gè)相互通信的 Kivy 應(yīng)用程序

      Running multiple Kivy apps at same time that communicate with each other(同時(shí)運(yùn)行多個(gè)相互通信的 Kivy 應(yīng)用程序)
      <i id='qZTDL'><tr id='qZTDL'><dt id='qZTDL'><q id='qZTDL'><span id='qZTDL'><b id='qZTDL'><form id='qZTDL'><ins id='qZTDL'></ins><ul id='qZTDL'></ul><sub id='qZTDL'></sub></form><legend id='qZTDL'></legend><bdo id='qZTDL'><pre id='qZTDL'><center id='qZTDL'></center></pre></bdo></b><th id='qZTDL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qZTDL'><tfoot id='qZTDL'></tfoot><dl id='qZTDL'><fieldset id='qZTDL'></fieldset></dl></div>
        <bdo id='qZTDL'></bdo><ul id='qZTDL'></ul>
            <tbody id='qZTDL'></tbody>

          • <tfoot id='qZTDL'></tfoot>

            1. <legend id='qZTDL'><style id='qZTDL'><dir id='qZTDL'><q id='qZTDL'></q></dir></style></legend>

                <small id='qZTDL'></small><noframes id='qZTDL'>

              1. 本文介紹了同時(shí)運(yùn)行多個(gè)相互通信的 Kivy 應(yīng)用程序的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我希望我的 Kivy 應(yīng)用程序能夠在 Windows 機(jī)器上生成多個(gè)可以相互通信的應(yīng)用程序(即新窗口).

                I would like my Kivy application to be able to spawn multiple apps (i.e. new windows) on a Windows machine that can communicate with each other.

                ScreenManager 和 Popup 選項(xiàng)不會(huì)削減它,因?yàn)樗鼈兾挥谕粋€(gè)窗口中..我需要能夠拖動(dòng)新屏幕多個(gè)顯示器,因此需要多個(gè)窗口.

                ScreenManager and Popup options will not cut it because they live in the same window..I need to be able to drag new screens across multiple monitors and therefore need multiple windows.

                Kivy 文檔明確聲明 "Kivy 僅支持一個(gè)窗口每個(gè)應(yīng)用程序:請不要嘗試創(chuàng)建多個(gè)."

                Kivy docs explicitly state that "Kivy supports only one window per application: please don't try to create more than one."

                谷歌搜索產(chǎn)生這種簡單的方法來自另一個(gè)應(yīng)用程序的新應(yīng)用程序,如下所示:

                A google search produces this simple approach of simple spawning a new app from within another app, like so:

                from kivy.app import App
                from kivy.uix.button import Button
                from kivy.uix.label import Label
                
                
                class ChildApp(App):
                    def build(self):
                        return Label(text='Child')
                
                
                class MainApp(App):
                
                    def build(self):
                        b = Button(text='Launch Child App')
                        b.bind(on_press=self.launchChild)
                        return b
                
                    def launchChild(self, button):
                        ChildApp().run()
                
                if __name__ == '__main__':
                    MainApp().run()
                

                但是,當(dāng)我這樣做時(shí),它會(huì)在同一窗口中啟動(dòng)應(yīng)用程序并崩潰,我的終端會(huì)像瘋了一樣吐出:

                However, when I do this, it launches the app within the same window and crashes, and my terminal spits out like crazy:

                Original exception was:
                Error in sys.exceptionhook:
                

                如果我使用 multiprocessing.Process(target=ChildApp().run()).start() 而不是 ChildApp().run() 我會(huì)得到相同的結(jié)果代碼>

                I get the same result if instead of ChildApp().run() I do multiprocessing.Process(target=ChildApp().run()).start()

                使用 subprocess 庫讓我更接近我想要的:

                Using the subprocess library gets me closer to what I want:

                # filename: test2.py
                
                from kivy.app import App
                from kivy.uix.label import Label
                
                
                class ChildApp(App):
                    def build(self):
                        return Label(text='Child')
                
                if __name__ == '__main__':
                    ChildApp().run()
                

                <小時(shí)>

                # filename: test.py
                
                from kivy.app import App
                from kivy.uix.button import Button
                
                import subprocess
                
                
                class MainApp(App):
                
                    def build(self):
                        b = Button(text='Launch Child App')
                        b.bind(on_press=self.launchChild)
                        return b
                
                    def launchChild(self, button):
                        subprocess.call('ipython test2.py', shell=True)
                
                if __name__ == '__main__':
                    MainApp().run()
                

                這會(huì)毫無錯(cuò)誤地生成子窗口,但是現(xiàn)在主窗口被鎖定(白色畫布),如果我關(guān)閉子窗口,它就會(huì)重新打開.

                This spawns the child window without error, however now the main window is locked (white canvas) and if I close the child window, it just gets reopened.

                他們需要能夠在彼此之間傳遞數(shù)據(jù).關(guān)于如何在 Windows 中正確執(zhí)行此操作的任何想法?這個(gè) post 似乎表明這是可能的,但我不知道從哪里開始.

                They need to be able pass data between one another. Any ideas on how to do this correctly in Windows? This post seems to suggest that this is possible but I'm not sure where to start.

                推薦答案

                bj0 關(guān)于子進(jìn)程的回答是正確的.

                bj0's answer regarding subprocess was correct.

                更好的是,我想出了如何通過多處理來做到這一點(diǎn),這允許在應(yīng)用程序之間更好地通信和傳遞信息.它以前不起作用,因?yàn)槲以?multiprocessing.Process(target=ChildApp().run()).start() 應(yīng)該是 multiprocessing.Process(target=ChildApp().run).start().以下作品

                Even better, I figured out how to do this via multiprocessing, which allows better communication and passing of information between apps. It wasn't working before because I did multiprocessing.Process(target=ChildApp().run()).start() when it should be multiprocessing.Process(target=ChildApp().run).start(). The following works

                # filename: test.py
                
                from kivy.app import App
                from kivy.uix.button import Button
                
                from test2 import ChildApp
                
                import multiprocessing
                
                
                class MainApp(App):
                
                    def build(self):
                        b = Button(text='Launch Child App')
                        b.bind(on_press=self.launchChild)
                        return b
                
                    def launchChild(self, button):
                        app = ChildApp()
                        p = multiprocessing.Process(target=app.run)
                        p.start()
                
                if __name__ == '__main__':
                    MainApp().run()
                

                <小時(shí)>

                # filename: test2.py
                
                from kivy.app import App
                from kivy.uix.label import Label
                
                
                class ChildApp(App):
                    def build(self):
                        return Label(text='Child')
                
                if __name__ == '__main__':
                    ChildApp().run()
                

                這篇關(guān)于同時(shí)運(yùn)行多個(gè)相互通信的 Kivy 應(yīng)用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                message.channel.id Discord PY(message.channel.id Discord PY)
                How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)

                      <bdo id='w4ixw'></bdo><ul id='w4ixw'></ul>
                        <tbody id='w4ixw'></tbody>

                    • <legend id='w4ixw'><style id='w4ixw'><dir id='w4ixw'><q id='w4ixw'></q></dir></style></legend>
                    • <tfoot id='w4ixw'></tfoot>

                          <i id='w4ixw'><tr id='w4ixw'><dt id='w4ixw'><q id='w4ixw'><span id='w4ixw'><b id='w4ixw'><form id='w4ixw'><ins id='w4ixw'></ins><ul id='w4ixw'></ul><sub id='w4ixw'></sub></form><legend id='w4ixw'></legend><bdo id='w4ixw'><pre id='w4ixw'><center id='w4ixw'></center></pre></bdo></b><th id='w4ixw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='w4ixw'><tfoot id='w4ixw'></tfoot><dl id='w4ixw'><fieldset id='w4ixw'></fieldset></dl></div>

                          <small id='w4ixw'></small><noframes id='w4ixw'>

                        1. 主站蜘蛛池模板: 国产乱码一区 | 欧美日韩1区 | 国产色婷婷精品综合在线手机播放 | 欧美日韩国产精品一区 | 日日天天 | 日韩欧美精品在线 | 午夜影院视频 | 欧美成人一区二区 | caoporon| 日韩欧美国产一区二区三区 | 盗摄精品av一区二区三区 | 国产精品欧美一区二区三区 | www.色综合| 久久久蜜桃一区二区人 | 亚洲免费精品 | 先锋av资源网 | 成人影音 | 成人在线免费 | 欧美最猛黑人xxxⅹ 粉嫩一区二区三区四区公司1 | 99re视频 | 国产视频三级 | 成人午夜免费视频 | 日韩国产精品一区二区三区 | 亚洲精品女优 | 国产999精品久久久久久 | 日日夜夜精品免费视频 | 中文在线一区二区 | 九九久久在线看 | 一级二级三级在线观看 | 伊人狠狠干 | 伊人焦久影院 | 精品国产不卡一区二区三区 | 在线免费观看视频黄 | 天堂中文av | 91久久夜色精品国产网站 | 伊人网综合在线 | 久久久综合网 | 日韩一区二区三区在线 | 成人av免费在线观看 | 91精品国产综合久久久久久蜜臀 | 国产精品视频一区二区三区四蜜臂 |