Cov txheej txheem:

Kuv yuav khiav Python program hauv localhost li cas?
Kuv yuav khiav Python program hauv localhost li cas?

Video: Kuv yuav khiav Python program hauv localhost li cas?

Video: Kuv yuav khiav Python program hauv localhost li cas?
Video: Opening a Jupyter Notebook from the Command Line! 2024, Hlis ntuj nqeg
Anonim

Kev xaiv 1: Siv Python localhost Server

  1. Xyuas thiab saib seb Python yog ntsia rau ntawm koj lub tshuab. Qhib kab hais kom ua kom pom tias Python yog ntsia.
  2. Khiav ib tug Python Hais kom ua hauv koj lub Web Folder pib koj lub zos server.
  3. Qhib koj localhost lub vev xaib hauv browser.
  4. Nres koj Python SimpleHTTPServer.

Ib yam li ntawd, kuv yuav ua li cas khiav Python server?

Configuring Apache Web Server los khiav Python ntawm Windows

  1. Nruab Python. Koj tuaj yeem tau txais Python los ntawm cov hauv qab no:
  2. Configure Apache kom khiav Python CGI. Cov kauj ruam tom ntej yog sivEditRocket los qhib httpd.conf apache configuration file nyob rau hauv apache install directory hauv conf directory.
  3. Rov pib Apache.
  4. Khiav ib nplooj ntawv xeem Python.

Ib yam li ntawd, kuv yuav ua li cas khiav Python program hauv xampp? 4 Teb

  1. Khiav Python hauv xampp rau windows:
  2. STEP-1: [Download Python]
  3. KAUJ RUAM 2: [Nruab Python] Nruab rau hauv ib qho kev qhia ntawm koj lub harddrive [ex.
  4. Kauj ruam 3: [Configure Python] XAMPP GUI tuaj yeem nkag mus rau httpd.conf cov ntaub ntawv sai li no:
  5. KAUJ RUAM 4: [yeem]
  6. Kauj ruam 5: [restart apache/xampp]
  7. Kauj ruam 6: [Khiav Python los ntawm xammp]

Tsis tas li ntawd, kuv yuav ua li cas thiaj li khiav Python tsab ntawv?

Khiav koj tsab ntawv

  1. Qhib kab hais kom ua: Pib ntawv qhia zaub mov -> Khiav thiab ntaus cmd.
  2. Hom: C:python27python.exe Z:codehw01script.py.
  3. Los yog yog tias koj lub kaw lus raug teeb tsa kom raug, koj tuaj yeem luag thiab xa koj tsab ntawv los ntawm Explorer mus rau qhov hais kom ua kab qhov rai thiab nias nkag.

Kuv yuav nkag mus rau kuv cov ntaub ntawv localhost HTML li cas?

Koj tuaj yeem khiav koj ntaub ntawv hauv http-server. 1> HaveNode.js ntsia hauv koj lub cev. 4> Mus rau koj tus browser thiab ntaus ntawv localhost :8080.

  1. mus rau folder uas koj muaj html file:
  2. Yog tias koj muaj cov ntaub ntawv html tshwj xeeb.
  3. los ntawm qhov chaw nres nkoj default yog 8080.
  4. Mus rau koj tus browser thiab ntaus localhost: 8080.

Pom zoo: