Lub ntsiab __ PY yog dab tsi?
Lub ntsiab __ PY yog dab tsi?

Video: Lub ntsiab __ PY yog dab tsi?

Video: Lub ntsiab __ PY yog dab tsi?
Video: dag kuv dab tsi By zoo xyooj 2024, Plaub Hlis Ntuj
Anonim

_ qhov tseem ceeb_ . py yog siv rau python cov program hauv zip file. Cov _ qhov tseem ceeb_ . py cov ntaub ntawv yuav raug tua thaum cov ntaub ntawv zip khiav. Piv txwv li, yog tias cov ntaub ntawv zip yog xws li: kuaj.

Ntawm no, _ lub ntsiab _ hauv Python yog dab tsi?

_ npe _ : Txhua module hauv Python muaj tus cwj pwm tshwj xeeb hu ua _ npe _ . Nws yog ib tug built-in variable uas rov qab lub npe ntawm lub module. _ qhov tseem ceeb_ : Zoo li lwm yam lus programming, Python ib yam nkaus thiab muaj qhov ua tiav qhov nkag, piv txwv li, lub ntsiab . '_ lub ntsiab _' yog lub npe ntawm qhov uas nyob rau hauv uas cov txheej txheem saum toj kawg nkaus executes.

Qhov thib ob, _ Lub Npe _ txhais li cas hauv Python? Cov _npe_ variable (ob underscores ua ntej thiab tom qab) yog ib qho tshwj xeeb Python sib txawv. Nws tau txais nws tus nqi nyob ntawm seb peb ua li cas cov ntawv uas muaj. Qee zaum koj sau tsab ntawv nrog cov haujlwm uas yuav muaj txiaj ntsig zoo hauv lwm cov ntawv sau thiab. Hauv Python , koj tuaj yeem import cov ntawv ntawd ua ib qho module hauv lwm tsab ntawv.

Ua raws li qhov xav tau, Main Py txhais li cas?

Python lub ntsiab muaj nuj nqi. Main muaj nuj nqi yog cov nkag point ntawm txhua qhov kev pab cuam. Yog vim li cas thiaj muaj cov txheej txheem tshwj xeeb rau txhais lub ntsiab txoj hauv kev python program, kom nws tau txais tsuas yog thaum qhov kev pab cuam yog khiav ncaj qha thiab tsis raug tua thaum imported raws li ib tug module.

Python puas xav tau lub ntsiab?

Hauv Python , tsis yog tsim nyog los txhais cov lub ntsiab ua haujlwm txhua zaus koj sau qhov program. Qhov no yog vim qhov Python tus neeg txhais lus executes los ntawm sab saum toj ntawm cov ntaub ntawv tshwj tsis yog ib tug tshwj xeeb muaj nuj nqi yog txhais.

Pom zoo: