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

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

      1. <small id='9Q3H3'></small><noframes id='9Q3H3'>

        <legend id='9Q3H3'><style id='9Q3H3'><dir id='9Q3H3'><q id='9Q3H3'></q></dir></style></legend>
      2. 如何從 qdateEdit 獲取用戶輸入并從 postgres 的數(shù)據(jù)

        how to get user input from qdateEdit and select it from database in postgres(如何從 qdateEdit 獲取用戶輸入并從 postgres 的數(shù)據(jù)庫中選擇它)

        1. <small id='wYnrL'></small><noframes id='wYnrL'>

        2. <legend id='wYnrL'><style id='wYnrL'><dir id='wYnrL'><q id='wYnrL'></q></dir></style></legend>
          • <bdo id='wYnrL'></bdo><ul id='wYnrL'></ul>

                  <tfoot id='wYnrL'></tfoot>

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

                    <tbody id='wYnrL'></tbody>
                  本文介紹了如何從 qdateEdit 獲取用戶輸入并從 postgres 的數(shù)據(jù)庫中選擇它的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想知道如何在 QDateEdit 中獲取用戶輸入并在 postgres 的表格中選擇它?這是我的代碼

                  i want to know how to get the user input in QDateEdit and select it in a table in postgres? here is my code

                   def date(self):
                  
                          try:
                              date = self.dateEdit.date()
                              print(date)
                              conn = psycopg2.connect(dbname="sample", user="postgres", password="admin", host="localhost", port="5432")
                              cur = conn.cursor()
                              cur.execute("SELECT * FROM data WHERE stdate = '%s'",date)
                              result = cur.fetchall()
                              self.tableWidget.setRowCount(0)
                              for row_number, row_data in enumerate(result):
                                  self.tableWidget.insertRow(row_number)
                                  for column_number, data in enumerate(row_data):
                                      self.tableWidget.setItem(row_number, column_number, QTableWidgetItem(str(data)))
                          except Exception as e:
                              print("Error")
                  

                  這部分有問題

                  cur.execute("SELECT * FROM data WHERE stdate = '%s'",date)
                  

                  如何從 QDateEdit 獲取日期并在 postgres 的表格中選擇它?

                  how do i get the date from QDateEdit and select it in the table in postgres?

                  我只想選擇標(biāo)準(zhǔn)日期等于用戶在 QDateEdit 中輸入的日期的行,并在我單擊選擇數(shù)據(jù)按鈕時(shí)將其顯示在 QtableView 中

                  and i only want to select the rows where the stdate is equal to the date that the user input in the QDateEdit and display it in the QtableView when i click the select data button

                  推薦答案

                  你必須:

                  • 使用 datetime.time() 而不是 QDate.
                  • 占位符不帶引號.
                  dt = self.dateEdit.date().toPyDate()
                  cur.execute("SELECT * FROM data WHERE stdate = %s", (dt,))
                  

                  這篇關(guān)于如何從 qdateEdit 獲取用戶輸入并從 postgres 的數(shù)據(jù)庫中選擇它的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數(shù)綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進(jìn)度躍升至 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 刻度標(biāo)簽設(shè)置在固定位置,以便當(dāng)我向左或向右滾動時(shí),yaxis 刻度標(biāo)簽應(yīng)該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構(gòu)造函數(shù)有未知關(guān)鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時(shí)顯示進(jìn)度條?)

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

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

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

                          • <legend id='U42NW'><style id='U42NW'><dir id='U42NW'><q id='U42NW'></q></dir></style></legend>
                            主站蜘蛛池模板: 好姑娘影视在线观看高清 | 国产午夜影院 | 免费a网站 | 免费h在线| 国产成人综合久久 | 亚欧洲精品在线视频免费观看 | 国产一区二区精品在线 | 午夜精品一区二区三区在线观看 | 亚洲风情在线观看 | 成人网av | 亚洲视频在线看 | a级在线免费| 免费观看一级黄色录像 | 欧美在线a| 女同久久另类99精品国产 | 日韩欧美不卡 | 天天操天天干天天曰 | 久久国产婷婷国产香蕉 | 日韩视频在线播放 | 狠狠艹 | 中文字幕国 | 亚洲一区日韩 | 成人免费网站在线 | 国产99精品| 在线黄色影院 | 爱爱综合网| 日韩精品免费 | 成人在线免费av | 国产精品视频网址 | 少妇一级淫片免费播放 | 精品国产一区二区三区成人影院 | 国产精品1区 | 九九热免费观看 | 国产一区二区三区四区在线观看 | 一区二区三区四区电影视频在线观看 | 在线观看黄色 | 中文在线一区二区 | 免费的日批视频 | 久久午夜精品 | 精品亚洲一区二区三区 | 亚洲欧美激情精品一区二区 |