python2.#與python3.#下tkinter 的simpledialog,messagebox


(windows下)python2.x有關Tkinter,simpledialog,messagebox的問題

python3是tkinter,python2中是Tkinter

 

[python]
 
  1. #python2下  
  2. from Tkinter import *  
  3.   
  4. import tkSimpleDialog as dl  
  5. import tkMessageBox as mb  
  6.   
  7. root=Tk()  
  8. w=Label(root,text="Label Title")  
  9. w.pack()  
  10.   
  11. mb.showinfo("welcome","Welcome Message")  
  12. guess=dl.askinteger("Number","Enter a number")  
  13.   
  14. output='This is output message'  
  15. mb.showinfo("Output:",output)  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM