Cov txheej txheem:

Kuv yuav sau ib tsab ntawv python li cas?
Kuv yuav sau ib tsab ntawv python li cas?

Video: Kuv yuav sau ib tsab ntawv python li cas?

Video: Kuv yuav sau ib tsab ntawv python li cas?
Video: Python! Writing pandas DataFrames to Multiple Tabs in a Spreadsheet 2024, Kaum ib hlis
Anonim

python yog ib hom lus txhais, yog li koj tsis tas yuav sau ua ke koj ntawv kom lawv khiav. Txoj hauv kev yooj yim tshaj plaws kom tau txais ib qho kev khiav yog mus rau nws lub nplaub tshev hauv lub davhlau ya nyob twg thiab ua tiav " python qee cov ntaub ntawv. py ".

Raws li qhov tshwm sim, kuv yuav sau cov ntawv Python hauv Windows li cas?

Khiav ib Python tsab ntawv hauv qab Qhov rai nrog rau Hais kom ua Nco ntsoov tias koj yuav tsum siv tag nrho txoj hauv kev Python neeg 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.

Ib yam li ntawd, Python puas yuav tsum tau sau ua ke? Koj qhov kev xav tsis yog lawm, Python xav tau compiler rau execute Python cov kev pab cuam. Tab sis txij li thaum koj muab piv Python nrog rau lwm yam lus xws li c, c ++, Java yog vim li cas koj thiaj li xaus qhov ntawd Python tsis yog xav tau compiler. Compilers: Hloov cov kev pab cuam qib siab rau nws lub tshuab lossis CPU cov lus qhia teev kuv, e tshuab bytecode.

Yog li ntawd, kuv yuav khiav Python tsab ntawv li cas?

Rau khiav Python scripts nrog rau python hais kom ua, koj yuav tsum qhib kab hais kom ua thiab ntaus hauv lo lus python , lossis python3 yog tias koj muaj ob qho tib si, ua raws li txoj hauv kev rau koj tsab ntawv , ib yam li no: $python3 hello.py Nyob zoo ntiaj teb!

Kuv yuav siv py2exe li cas?

Muaj ob peb kauj ruam yooj yim uas yuav tsum tau siv py2exe thaum koj tau teeb tsa nws:

  1. Tsim / sim koj qhov program.
  2. Tsim koj cov ntawv teeb tsa (setup.py)
  3. Khiav koj cov ntawv teeb tsa.
  4. Kuaj koj executable.
  5. Muab Microsoft Visual C runtime DLL. 5.1. Python 2.4 lossis 2.5. 5.2. Python 2.6, 2.7, 3.0, 3.1. 5.2.1.
  6. Tsim tus installer yog tias tsim nyog.

Pom zoo: