国产午夜视频在线观看,国产国拍精品av在线观看,国产国产人免费人成免费视频,国产福利视频一区二区在线,国产av免费一区二区三区

廈門(mén)服務(wù)器租用>動(dòng)態(tài)撥號(hào)VPS>Ubuntu18.04系統(tǒng)如何安裝cherrypy

Ubuntu18.04系統(tǒng)如何安裝cherrypy

發(fā)布時(shí)間:2023/2/11 14:53:25

Ubuntu18.04系統(tǒng)如何安裝cherrypy

cherryPy是一個(gè)基于Python的面向?qū)ο蟮腍TTP框架。那么在ubuntu18.04中如何安裝cherrypy呢?本文給出詳細(xì)說(shuō)明。

1.首先確認(rèn)安裝了python3

Ubuntu18.04系統(tǒng)如何安裝cherrypy-1413

說(shuō)明:一般linux系統(tǒng)默認(rèn)都有安裝python環(huán)境,包括python2和python3,在命令行中python默認(rèn)指的是python2。python2已經(jīng)接近淘汰,但由于linux系統(tǒng)環(huán)境中還有大量基于python2的軟件,因此在linux系統(tǒng)中還保留著python2。目前推薦使用python3。

2.更新軟件列表

sudo apt-get update

Ubuntu18.04系統(tǒng)如何安裝cherrypy-1414

3.安裝python3-pip

sudo apt install python3-pip

Ubuntu18.04系統(tǒng)如何安裝cherrypy-1415

4.安裝requests庫(kù)

sudo pip3 install cherrypy

Ubuntu18.04系統(tǒng)如何安裝cherrypy-1416

5.編寫(xiě)測(cè)試程序

vi hello.py

寫(xiě)入測(cè)試程序

import cherrypy

class HelloWorld:

@cherrypy.expose

def hello(self):

return ‘hello’

cherrypy.quickstart(HelloWorld())

6.運(yùn)行

python3 hello.py

Ubuntu18.04系統(tǒng)如何安裝cherrypy-1417

在線客服
微信公眾號(hào)
免費(fèi)撥打400-1886560
免費(fèi)撥打0592-5580190 免費(fèi)撥打 400-1886560 或 0592-5580190
返回頂部
返回頭部 返回頂部