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

  • <small id='HzzMV'></small><noframes id='HzzMV'>

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

      <legend id='HzzMV'><style id='HzzMV'><dir id='HzzMV'><q id='HzzMV'></q></dir></style></legend>
        <bdo id='HzzMV'></bdo><ul id='HzzMV'></ul>

        在使用 PyInstaller --onefile 打包 kivy 時包含 .kv/.js

        Include .kv/.json files while packaing kivy with PyInstaller --onefile?(在使用 PyInstaller --onefile 打包 kivy 時包含 .kv/.json 文件?)
        <tfoot id='nAGa1'></tfoot>
          <tbody id='nAGa1'></tbody>

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

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

                  <legend id='nAGa1'><style id='nAGa1'><dir id='nAGa1'><q id='nAGa1'></q></dir></style></legend>

                  <i id='nAGa1'><tr id='nAGa1'><dt id='nAGa1'><q id='nAGa1'><span id='nAGa1'><b id='nAGa1'><form id='nAGa1'><ins id='nAGa1'></ins><ul id='nAGa1'></ul><sub id='nAGa1'></sub></form><legend id='nAGa1'></legend><bdo id='nAGa1'><pre id='nAGa1'><center id='nAGa1'></center></pre></bdo></b><th id='nAGa1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nAGa1'><tfoot id='nAGa1'></tfoot><dl id='nAGa1'><fieldset id='nAGa1'></fieldset></dl></div>
                • 本文介紹了在使用 PyInstaller --onefile 打包 kivy 時包含 .kv/.json 文件?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個非常簡單的應(yīng)用程序(只是一個帶有標(biāo)簽的窗口),我正在嘗試引導(dǎo)自己完成轉(zhuǎn)換為單個可執(zhí)行文件的過程.這是程序目錄:

                  I've got a very simple App (just a window with a label) and I am trying to walk myself through the process of turning into a single executable. Here is the program directory:

                  brainfreeze/
                     main.py # simple app
                     main.kv # kv language style sheet
                     config/
                        settings.json # json settings panel data (F1 bound)
                  saving_to/
                     (empty at start)
                  

                  我已成功使用 PyInstaller 將程序編譯為可執(zhí)行文件,但僅使用其 docs;我希望改用一個文件捆綁方法.到目前為止,當(dāng)我編譯時,應(yīng)用程序啟動但它是一個黑屏(傳統(tǒng)上我在 main.kv 無法加載時看到這個).我已閱讀 this, 這個,this 甚至 PyInstaller docs 但未能成功編譯為單個可執(zhí)行文件.這是 prog_test.spec:

                  I've successfully used PyInstaller to compile the program to an executable, but only using the one folder bundle method described in their docs; I'm looking to use the one file bundle method instead. So far, when I compile, the App launches but its a black screen (traditionally I have seen this when the main.kv cannot be loaded). I've read this, this, this and even the PyInstaller docs but have had no luck in successfully compiling to a single executable. Here is the prog_test.spec:

                  # -*- mode: python -*-
                  
                  from kivy.deps import sdl2
                  from kivy.deps import glew
                  
                  block_cipher = None
                  
                  a = Analysis(['..\brainfreeze\main.py'],
                               pathex=['H:\TestBed\single_exe_test'],
                               binaries=[],
                               data=[],
                               hiddenimports=[],
                               hookspath=[],
                               runtime_hooks=[],
                               excludes=[],
                               win_no_prefer_redirects=False,
                               win_private_assemblies=False,
                               cipher=block_cipher)
                  
                  pyz = PYZ(a.pure, a.zipped_data,
                               cipher=block_cipher)
                  
                  a.datas += [('../brainfreeze/main.kv', 'DATA'), ('../brainfreeze/config/settings.json', 'DATA')]
                  
                  exe = EXE(pyz, Tree('../brainfreeze/'),
                            a.scripts,
                            a.binaries,
                            a.zipfiles,
                            a.datas,
                            *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
                            name='prog_test',
                            debug=False,
                            strip=False,
                            upx=True,
                            runtime_tmpdir=None,
                            console=True)
                  

                  我很好奇是否是 a.datas 附加方法導(dǎo)致了問題,因為所有示例都有 3 個索引,而文檔只有 2 個索引.我的命令順序如下:

                  I'm curious if it is the a.datas appending method causing problems, since all the examples have 3 indices while the documentation only has 2 indices. My command sequence is the following:

                  # from the 'saving to' directory
                  python -m PyInstaller --onefile --name prog_test ../brainfreeze/main.py
                  # alter the prog_test.spec to the above
                  python -m PyInstaller --onefile prog_test.spec
                  

                  我在包含支持(.kv、.json)文件方面做錯了什么?

                  What am I doing incorrectly to include the support (.kv, .json) files?

                  推薦答案

                  我也遇到了這個問題,一個非常簡單的例子,也讀過你提到的相同文章.同樣,我的應(yīng)用程序在捆綁在一個文件夾中而不是在單個 exe 文件中時可以工作.我將 kivy 應(yīng)用程序類移動到一個單獨的 .py 文件中,所以主文件看起來像這樣:

                  I was also having this problem with a very simple example and had also read the same articles that you mentioned. Similarly, my app worked when bundled in a folder but not in a single exe file. I moved the kivy app class to a separate .py file so the main file looked something like this:

                  import os, sys
                  from kivy.resources import resource_add_path, resource_find
                  from myApp import AppClass
                  
                  if __name__ == '__main__':
                      if hasattr(sys, '_MEIPASS'):
                          resource_add_path(os.path.join(sys._MEIPASS))
                  
                      app = AppClass()
                      app.run()
                  

                  myapp.kv 作為數(shù)據(jù)添加到規(guī)范文件中.這對我有用.我的懷疑是kivy資源路徑首先需要在python腳本中導(dǎo)入任何其他kivy包之前添加meipass目錄.

                  The myapp.kv was added in the spec file as data. And this worked for me. My suspicion is that the kivy resource path first needs to add the meipass directory before importing any other kivy packages in the python script.

                  這篇關(guān)于在使用 PyInstaller --onefile 打包 kivy 時包含 .kv/.json 文件?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                    <bdo id='LPKu2'></bdo><ul id='LPKu2'></ul>
                      <tbody id='LPKu2'></tbody>

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

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

                      3. <i id='LPKu2'><tr id='LPKu2'><dt id='LPKu2'><q id='LPKu2'><span id='LPKu2'><b id='LPKu2'><form id='LPKu2'><ins id='LPKu2'></ins><ul id='LPKu2'></ul><sub id='LPKu2'></sub></form><legend id='LPKu2'></legend><bdo id='LPKu2'><pre id='LPKu2'><center id='LPKu2'></center></pre></bdo></b><th id='LPKu2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LPKu2'><tfoot id='LPKu2'></tfoot><dl id='LPKu2'><fieldset id='LPKu2'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 国产精品久久精品 | 国产精品theporn | 天天射天天干 | 亚洲国产成人精品女人久久久 | 午夜影院在线观看视频 | 成人国产精品色哟哟 | 伊人久操| 超碰激情 | 亚洲精品自拍视频 | 久久99视频精品 | 最新日韩在线 | 亚洲欧美日韩在线 | 亚州春色 | 免费一级黄色录像 | 国产成人精品免费视频 | 日韩毛片 | 91视频国产一区 | 亚洲精品久久久久久久久久久久久 | 自拍偷拍亚洲一区 | 精品亚洲永久免费精品 | 欧美黄色大片在线观看 | 国产区视频在线观看 | 久久国产精品视频 | 欧美日韩视频在线第一区 | 久久国产精品视频 | 久久97精品 | 在线视频 欧美日韩 | 午夜精品久久久久久久久久久久久 | 青青艹在线视频 | 日日干天天操 | 91超碰在线观看 | 国产精品高潮呻吟久久av野狼 | 欧美日韩一区二区在线观看 | 视频在线一区 | 先锋av资源在线 | 天天天天操 | 欧美日韩三级视频 | 日韩一区二区三区视频 | 天天射视频 | 免费网站在线 | 2022国产精品|