Python canvas yog dab tsi?
Python canvas yog dab tsi?

Video: Python canvas yog dab tsi?

Video: Python canvas yog dab tsi?
Video: Dan Yeaw - 5 Steps to Build Python Native GUI Widgets for BeeWare - PyCon 2019 2024, Kaum ib hlis
Anonim

Python - Tkinter Canvas . Kev tshaj tawm. Cov Canvas yog ib cheeb tsam uas npaj rau kev kos duab lossis lwm yam layouts. Koj tuaj yeem tso cov duab, ntawv nyeem, widgets lossis thav duab ntawm a Canvas.

Xav txog qhov no, lub canvas hauv Python yog dab tsi?

Python - Tkinter Canvas . Kev tshaj tawm. Cov Canvas yog ib cheeb tsam uas npaj rau kev kos duab lossis lwm yam layouts. Koj tuaj yeem tso cov duab, ntawv nyeem, widgets lossis thav duab ntawm a Canvas.

Ib sab saum toj no, koj ua li cas tshem cov canvas hauv Python? Luv teb: hu daim ntaub . rho tawm ('tag nrho') yuav meej tag nrho daim ntaub . Kuv yuav rhuav tshem () lub daim ntaub thiab tom qab ntawd rov pib lub phiaj xwm (). Ua li no koj yuav tsum ua daim ntaub chav kawm cwj pwm zoo li no tus kheej.

Tsis tas li ntawd, dab tsi yog ncej hauv Python?

Nws ua haujlwm zoo li lub thawv, uas yog lub luag haujlwm rau kev teeb tsa txoj haujlwm ntawm lwm cov widget. Nws siv cov duab plaub hauv qhov screen los teeb tsa cov txheej txheem thiab muab padding ntawm cov widgets no. A ncej kuj tseem siv tau los ua cov chav kawm hauv paus los siv cov widgets nyuaj.

tkinter Mainloop ua dab tsi?

mainloop () yog ib lub voj infinite siv los khiav daim ntawv thov, tos kom muaj ib qho xwm txheej tshwm sim thiab ua cov xwm txheej ntev npaum li lub qhov rais tsis raug kaw.

Pom zoo: