Cov txheej txheem:

Kuv tus neeg txhais lus python nyob qhov twg?
Kuv tus neeg txhais lus python nyob qhov twg?

Video: Kuv tus neeg txhais lus python nyob qhov twg?

Video: Kuv tus neeg txhais lus python nyob qhov twg?
Video: Python! Flattening Nested Lists 2024, Kaum ib hlis
Anonim

2. Siv tus neeg txhais lus Python

  1. 2.1. Hu rau tus txhais lus. Tus neeg txhais lus Python feem ntau yog ntsia raws li /usr/local/bin/python3.8 ntawm cov tshuab uas nws muaj; tso /usr/local/bin rau hauv koj lub plhaub Unix txoj kev tshawb nrhiav ua rau nws tuaj yeem pib nws los ntawm kev ntaus cov lus txib: python3.8.
  2. 2.2. Tus Txhais Lus thiab Nws Ib Cheeb Tsam. 2.2.

Raws li txoj cai, kuv tuaj yeem nrhiav tus neeg txhais lus Python nyob qhov twg?

2. Siv tus neeg txhais lus Python

  • Tus neeg txhais lus Python feem ntau yog ntsia raws li /usr/local/bin/python ntawm cov tshuab uas nws muaj; muab /usr/local/bin rau hauv koj lub plhaub Unix txoj kev tshawb nrhiav ua rau nws muaj peev xwm pib nws los ntawm kev ntaus cov lus txib.
  • mus rau lub plhaub.

Qhov thib ob, koj yuav kuaj xyuas seb kuv puas tau teeb tsa Python? Yog koj tau nruab Python ces qhov yooj yim tshaj uas koj ua tau kuaj tus lej version yog los ntawm kev ntaus " python " nyob rau hauv koj qhov kev hais kom ua. Nws yuav qhia koj tus lej version thiab yog nws khiav ntawm 32 ntsis lossis 64 ntsis thiab qee cov ntaub ntawv. Rau qee cov ntawv thov koj xav tau muaj qhov tseeb version thiab qee zaum tsis.

Raws li, tus neeg txhais lus Python nyob qhov twg ntawm Windows?

  1. Hauv qhov hais kom ua, ntaus python thiab nias Enter.
  2. Hauv Windows nrhiav bar, ntaus hauv python.exe, tab sis tsis txhob nyem rau ntawm nws hauv cov ntawv qhia zaub mov.
  3. Lub qhov rais yuav qhib nrog qee cov ntaub ntawv thiab cov folders: qhov no yuav tsum yog qhov chaw Python tau teeb tsa.
  4. Los ntawm cov ntawv qhia zaub mov tseem ceeb Windows, qhib Control Panel:

Kuv yuav khiav tus neeg txhais lus Python li cas?

Khiav a Python tsab ntawv nyob rau hauv Windows nrog Command Prompt Nco ntsoov tias koj yuav tsum siv tag nrho txoj hauv kev Python txhais lus . Yog tias koj xav tau yooj yim ntaus ntawv python .exe C:UsersUsernameDesktopmy_python_script.py koj yuav tsum ntxiv python .exe rau koj PATH ib puag ncig hloov pauv.

Pom zoo: