Cov txheej txheem:

Kuv yuav tsim Python pob li cas?
Kuv yuav tsim Python pob li cas?

Video: Kuv yuav tsim Python pob li cas?

Video: Kuv yuav tsim Python pob li cas?
Video: Creating a Virtual Environment within a Jupyter Notebook! 2024, Kaum ib hlis
Anonim

Python - Tsim thiab txhim kho pob

  1. Tsim ib lub nplaub tshev tshiab hu ua D: MyApp.
  2. Hauv MyApp, tsim subfolder nrog lub npe 'mypackage'.
  3. Tsim ib qho khoob _init_.py cov ntaub ntawv hauv mypackage folder.
  4. Siv a Python -paub editor zoo li IDLE, tsim modules greet.py thiab functions.py nrog cov cai hauv qab no:

Ib yam li ntawd, kuv yuav ua li cas thiaj tsim tau pob python installable?

  1. Teeb tsa koj qhov project. Tsim ib pob hais tias, dokr_pkg.
  2. Compiling Koj pob. Mus rau hauv koj lub pob ntawv tais ceev tseg thiab ua raws li cov lus txib no: python setup.py bdist_wheel.
  3. Nruab rau ntawm Koj Lub Tshuab Hauv Zos. Yog tias koj xav sim koj daim ntawv thov ntawm koj lub tshuab hauv zos, koj tuaj yeem nruab cov ntaub ntawv.whl siv pip:
  4. Upload rau pip.
  5. Xaus.

Tsis tas li ntawd, ua li cas koj ua ib tug python? Nov yog cov kauj ruam koj yuav tsum tau ua los tsim Python los ntawm qhov chaw:

  1. Kauj ruam 1: Download tau qhov Source Code. Txhawm rau pib, koj yuav tsum tau txais Python qhov chaws.
  2. Kauj ruam 2: Npaj Koj Qhov System. Muaj ob peb qhov kev cuam tshuam tshwj xeeb hauv kev tsim Python los ntawm kos.
  3. Kauj ruam 3: Tsim Python.
  4. Kauj ruam 4: Txheeb xyuas koj Python Install.

Hauv qhov no, dab tsi yog pob hauv Python nrog piv txwv?

Pob ntawv yog ib txoj hauv kev Python's module namespace los ntawm kev siv "dotted module npe "A. B stands rau ib tug submodule npe B nyob rau hauv a pob npe A. Ob tug txawv pob khoom zoo li P1 thiab P2 tuaj yeem muaj cov qauv nrog tib lub npe, cia peb hais A, rau piv txwv.

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: