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

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

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

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

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

        我應該在我的 PyQt 應用程序中使用 `app.exec()` 還是

        Should I use `app.exec()` or `app.exec_()` in my PyQt application?(我應該在我的 PyQt 應用程序中使用 `app.exec()` 還是 `app.exec_()`?)
        <legend id='6GF5s'><style id='6GF5s'><dir id='6GF5s'><q id='6GF5s'></q></dir></style></legend>

              <tbody id='6GF5s'></tbody>

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

                • <small id='6GF5s'></small><noframes id='6GF5s'>

                  本文介紹了我應該在我的 PyQt 應用程序中使用 `app.exec()` 還是 `app.exec_()`?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我使用 Python 3 和 PyQt5.這是我的測試 PyQt5 程序,關注最后兩行:

                  I use Python 3 and PyQt5. Here's my test PyQt5 program, focus on the last 2 lines:

                  from PyQt5.QtCore import *
                  from PyQt5.QtWidgets import *
                  import sys
                  
                  class window(QWidget):
                  def __init__(self,parent=None):
                      super().__init__(parent)
                      self.setWindowTitle('test')
                      self.resize(250,200)
                  
                  app=QApplication(sys.argv)
                  w=window()
                  w.show()
                  sys.exit(app.exec())
                  #sys.exit(app.exec_())
                  

                  我知道 exec 是 Python 中的語言關鍵字.但是 Official PyQt5 Documentation 上的代碼(特別是 Object Destruction on Exit 部分).我看到該示例顯示了 app.exec() 的使用,這讓我感到困惑.

                  I know exec is a language keyword in Python. But code on Official PyQt5 Documentation (specifically the Object Destruction on Exit part). I see that example shows use of app.exec() which confuses me.

                  當我在我的機器上測試它時.我發現與我的結局沒有任何明顯的區別.使用和不使用 _ 都會在沒有時間差的情況下產生相同的輸出.

                  When I tested it on my machine. I found there is no any visible difference from my end. Both with and without _ produces the same output in no time difference.

                  我的問題是:

                  • 我使用 app.exec() 有什么問題嗎?喜歡與 Python 的內部 exec 沖突?我懷疑是因為兩個 exec 都在執行某些東西.
                  • 如果不能,我可以同時使用兩者嗎?
                  • Is there anything wrong going when I use app.exec()? like clashing with Python's internal exec? I suspect because both exec's are executing something.
                  • If not, can I use both interchangeably?

                  推薦答案

                  那是因為在 Python 3 之前,exec 是一個保留關鍵字,因此 PyQt 開發人員為其添加了下劃線.從 Python 3 開始,exec 不再是保留關鍵字(因為它是一個內置函數;與 print 的情況相同),所以在 PyQt5 中提供一個不帶下劃線的版本以與 C++ 文檔保持一致是有意義的,但保留一個帶下劃線的版本是為了向后兼容.所以對于帶有 Python 3 的 PyQt5,這兩個 exec 函數是相同的.對于較舊的 PyQt,只有 exec_() 可用.

                  That's because until Python 3, exec was a reserved keyword, so the PyQt devs added underscore to it. From Python 3 onwards, exec is no longer a reserved keyword (because it is a builtin function; same situation as print), so it made sense in PyQt5 to provide a version without an underscore to be consistent with C++ docs, but keep a version with underscore for backwards compatibility. So for PyQt5 with Python 3, the two exec functions are the same. For older PyQt, only exec_() is available.

                  這篇關于我應該在我的 PyQt 應用程序中使用 `app.exec()` 還是 `app.exec_()`?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                  <i id='7tPEG'><tr id='7tPEG'><dt id='7tPEG'><q id='7tPEG'><span id='7tPEG'><b id='7tPEG'><form id='7tPEG'><ins id='7tPEG'></ins><ul id='7tPEG'></ul><sub id='7tPEG'></sub></form><legend id='7tPEG'></legend><bdo id='7tPEG'><pre id='7tPEG'><center id='7tPEG'></center></pre></bdo></b><th id='7tPEG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7tPEG'><tfoot id='7tPEG'></tfoot><dl id='7tPEG'><fieldset id='7tPEG'></fieldset></dl></div>
                  <tfoot id='7tPEG'></tfoot>
                  <legend id='7tPEG'><style id='7tPEG'><dir id='7tPEG'><q id='7tPEG'></q></dir></style></legend>

                      <small id='7tPEG'></small><noframes id='7tPEG'>

                      • <bdo id='7tPEG'></bdo><ul id='7tPEG'></ul>

                            <tbody id='7tPEG'></tbody>
                            主站蜘蛛池模板: 一久久久 | 国产精品久久久久久久久久久久午夜片 | 国产日韩亚洲欧美 | www.一区二区三区.com | 美女毛片免费看 | 免费a大片| 伊人一区 | www一级片 | 精品欧美 | 在线中文字幕视频 | 每日更新av | 二区欧美| 一区二区视频免费观看 | 日韩欧美在线观看 | 国产伦精品一区二区三区四区视频 | 亚洲伊人精品酒店 | 91网站在线观看视频 | 国产高清一区二区三区 | 久久99网| 国产美女免费视频 | 一级h片| 红色av社区 | 一级看片 | 精品视频在线播放 | 国产精品久久久久久久久久久久久久 | 网黄在线 | 成人国产免费观看 | dy天堂| 国产精品视频一区二区三区 | 国产美女精品 | 亚洲网站在线观看 | 一区二区三区视频 | 日本一二三区高清 | 自拍中文字幕 | 欧美三区视频 | 国产农村妇女毛片精品久久麻豆 | 完全免费在线视频 | 综合网在线 | 久草视频网站 | 亚洲综合免费 | 99视频在线免费观看 |