pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <tfoot id='tAwfP'></tfoot>
      <bdo id='tAwfP'></bdo><ul id='tAwfP'></ul>

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

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

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

      1. 如何在 tkinter、Python 3.2.5 的文本框中打印并讓用

        How do I print and have user input in a text box in tkinter, Python 3.2.5?(如何在 tkinter、Python 3.2.5 的文本框中打印并讓用戶輸入?)
        <i id='XRrbl'><tr id='XRrbl'><dt id='XRrbl'><q id='XRrbl'><span id='XRrbl'><b id='XRrbl'><form id='XRrbl'><ins id='XRrbl'></ins><ul id='XRrbl'></ul><sub id='XRrbl'></sub></form><legend id='XRrbl'></legend><bdo id='XRrbl'><pre id='XRrbl'><center id='XRrbl'></center></pre></bdo></b><th id='XRrbl'></th></span></q></dt></tr></i><div class="dhnt7td" id='XRrbl'><tfoot id='XRrbl'></tfoot><dl id='XRrbl'><fieldset id='XRrbl'></fieldset></dl></div>
        <legend id='XRrbl'><style id='XRrbl'><dir id='XRrbl'><q id='XRrbl'></q></dir></style></legend>
              <tfoot id='XRrbl'></tfoot>
                <tbody id='XRrbl'></tbody>

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

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

                  本文介紹了如何在 tkinter、Python 3.2.5 的文本框中打印并讓用戶輸入?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我對 Python 完全陌生,我剛剛編寫了一小段代碼,用于在 python shell 中打印并請求輸入.它就像一本日記,要求輸入日期,然后打印該日期的條目.我希望將此調用和響應合并到 tkinter GUI 中的文本框中.我想知道如何讓這段代碼在文本框中而不是在 python shell 中執行.

                  I am completely new to Python, and I just wrote a short bit of code that prints and asks for input in the python shell. It works like a diary where it asks for a date and then prints the entries for that date. I was hoping to incorporate this call and response into a text box in a tkinter GUI. I am wondering how to get this bit of code to perform in the text box instead of in the python shell.

                  month = int(float(input("Month(MM): ")))
                  day = int(float(input("Day(DD): ")))
                  year = int(float(input("Year(YYYY): ")))
                  
                  print(str(month)+"/"+str(day)+"/"+str(year))
                  
                  noEntry = True
                  
                  if month == 1 and day == 2 and year == 3456:
                      noEntry = False
                      print("Text")
                  if month == 7 and day == 8 and year == 9012:
                      noEntry = False
                      print("More Text")
                  if noEntry:
                      print("No Entry Found")
                  

                  我還想避免將此代碼作為外部文件調用.我想知道如何將此代碼實現到 tkinter GUI 文本框中,而不是如何檢索包含此代碼的文件.主要是因為它是一個如此短的程序,似乎沒有必要.提前感謝您的幫助!

                  I would also like to avoid calling for this code as an outside file. I want to know how to implement this code into a tkinter GUI text box, not how to retrieve a file which contains this code. Mostly because it is such a short program and it seems unnecessary. Thanks for the help in advance!

                  推薦答案

                  這是一個基本的 Tk 窗口,它將接受月、日和年的輸入

                  Here is a basic Tk window that will take input for month, day and year

                  from Tkinter import *
                  
                  root = Tk()
                  
                  
                  label1 = Label( root, text="Month(MM)")
                  E1 = Entry(root, bd =5)
                  
                  label2 = Label( root, text="Day(DD)")
                  E2 = Entry(root, bd =5)
                  
                  label3 = Label( root, text="Year(YYYY)")
                  E3 = Entry(root, bd =5)
                  
                  def getDate():
                      print E1.get()
                      print E2.get()
                      print E3.get()
                  
                  submit = Button(root, text ="Submit", command = getDate)
                  
                  label1.pack()
                  E1.pack()
                  label2.pack()
                  E2.pack()
                  label3.pack()
                  E3.pack()
                  submit.pack(side =BOTTOM) 
                  root.mainloop()
                  

                  當您單擊提交時,它會打印月份和年份,我相信您可以弄清楚從那里

                  when you click submit it prints the month day and year and im sure you can figure it out from there

                  編輯

                  這里是一個顯示日記條目的文本框示例:

                  here is an example of a text box to display the diary entry:

                  from Tkinter import *
                  
                  root = Tk()
                  text = Text(root)
                  text.insert(INSERT, diary)
                  text.pack()
                  
                  root.mainloop()
                  

                  在本例中,diary 是日記條目字符串!

                  in this example diary is the diary entry string!

                  祝你好運:)

                  這篇關于如何在 tkinter、Python 3.2.5 的文本框中打印并讓用戶輸入?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)
                  <i id='5E3iA'><tr id='5E3iA'><dt id='5E3iA'><q id='5E3iA'><span id='5E3iA'><b id='5E3iA'><form id='5E3iA'><ins id='5E3iA'></ins><ul id='5E3iA'></ul><sub id='5E3iA'></sub></form><legend id='5E3iA'></legend><bdo id='5E3iA'><pre id='5E3iA'><center id='5E3iA'></center></pre></bdo></b><th id='5E3iA'></th></span></q></dt></tr></i><div class="hz7pb77" id='5E3iA'><tfoot id='5E3iA'></tfoot><dl id='5E3iA'><fieldset id='5E3iA'></fieldset></dl></div>

                  <small id='5E3iA'></small><noframes id='5E3iA'>

                      • <bdo id='5E3iA'></bdo><ul id='5E3iA'></ul>

                            <tbody id='5E3iA'></tbody>

                          <tfoot id='5E3iA'></tfoot>
                        • <legend id='5E3iA'><style id='5E3iA'><dir id='5E3iA'><q id='5E3iA'></q></dir></style></legend>
                            主站蜘蛛池模板: 依维柯自动挡房车,自行式国产改装房车,小型房车价格,中国十大房车品牌_南京拓锐斯特房车 - 南京拓锐斯特房车 | 塑料瓶罐_食品塑料瓶_保健品塑料瓶_调味品塑料瓶–东莞市富慷塑料制品有限公司 | 成都治疗尖锐湿疣比较好的医院-成都治疗尖锐湿疣那家医院好-成都西南皮肤病医院 | 体视显微镜_荧光生物显微镜_显微镜报价-微仪光电生命科学显微镜有限公司 | 2025福建平潭岛旅游攻略|蓝眼泪,景点,住宿攻略-趣平潭网 | 壹作文_中小学生优秀满分作文大全| 福州甲醛检测-福建室内空气检测_环境检测_水质检测-福建中凯检测技术有限公司 | 塑料异型材_PVC异型材_封边条生产厂家_PC灯罩_防撞扶手_医院扶手价格_东莞市怡美塑胶制品有限公司 | 植筋胶-粘钢胶-碳纤维布-碳纤维板-环氧砂浆-加固材料生产厂家-上海巧力建筑科技有限公司 | 舞台木地板厂家_体育运动木地板_室内篮球馆木地板_实木运动地板厂家_欧氏篮球地板推荐 | 天津蒸汽/热水锅炉-电锅炉安装维修直销厂家-天津鑫淼暖通设备有限公司 | 环球电气之家-中国专业电气电子产品行业服务网站! | 福建自考_福建自学考试网| 塑料异型材_PVC异型材_封边条生产厂家_PC灯罩_防撞扶手_医院扶手价格_东莞市怡美塑胶制品有限公司 | 井式炉-台车式回火炉-丹阳市电炉厂有限公司 | 右手官网|右手工业设计|外观设计公司|工业设计公司|产品创新设计|医疗产品结构设计|EMC产品结构设计 | 广东佛电电器有限公司|防雷开关|故障电弧断路器|智能量测断路器 广东西屋电气有限公司-广东西屋电气有限公司 | 天津电机维修|水泵维修-天津晟佳机电设备有限公司 | VI设计-LOGO设计公司-品牌设计公司-包装设计公司-导视设计-杭州易象设计 | 楼承板-开口楼承板-闭口楼承板-无锡海逵 | 防腐储罐_塑料储罐_PE储罐厂家_淄博富邦滚塑防腐设备科技有限公司 | 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 冰晶石|碱性嫩黄闪蒸干燥机-有机垃圾烘干设备-草酸钙盘式干燥机-常州市宝康干燥 | 玻璃钢罐_玻璃钢储罐_盐酸罐厂家-河北华盛节能设备有限公司 | HDPE土工膜,复合土工膜,防渗膜价格,土工膜厂家-山东新路通工程材料有限公司 | 海峰资讯 - 专注装饰公司营销型网站建设和网络营销培训 | 杭州画室_十大画室_白墙画室_杭州美术培训_国美附中培训_附中考前培训_升学率高的画室_美术中考集训美术高考集训基地 | 仪器仪表网 - 永久免费的b2b电子商务平台| 济宁工业提升门|济宁电动防火门|济宁快速堆积门-济宁市统一电动门有限公司 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | 天津云仓-天津仓储物流-天津云仓一件代发-顺东云仓 | 欧景装饰设计工程有限公司-无锡欧景装饰官网 | 实验室pH计|电导率仪|溶解氧测定仪|离子浓度计|多参数水质分析仪|pH电极-上海般特仪器有限公司 | 石家庄小程序开发_小程序开发公司_APP开发_网站制作-石家庄乘航网络科技有限公司 | 骨龄仪_骨龄检测仪_儿童骨龄测试仪_品牌生产厂家【品源医疗】 | 跨境物流_美国卡派_中大件运输_尾程派送_海外仓一件代发 - 广州环至美供应链平台 | 山东齐鲁漆业有限公司【官网】-工业漆专业生产厂家 | 防弹玻璃厂家_防爆炸玻璃_电磁屏蔽玻璃-四川大硅特玻科技有限公司 | 达利园物流科技集团-| 尾轮组_头轮组_矿用刮板_厢式刮板机_铸石刮板机厂家-双驰机械 | 税筹星_灵活用工平台_企业财务顾问_财税法薪综合服务平台 |