python python3之http.server模塊#####
https://blog.csdn.net/qq_44159028/article/details/118099689
查看版本號(hào):python --version
Python 3.10.1
python共享文件
進(jìn)入對(duì)應(yīng)共享目錄:
- cmd進(jìn)入對(duì)應(yīng) terminal
2.ipconfig 查看本機(jī)ip 地址 比如192.168.222.108
3.開(kāi)啟本地web服務(wù):
python -m http.server 80
- 瀏覽器訪(fǎng)問(wèn)對(duì)應(yīng)ip http://192.168.222.108:80
cmd進(jìn)入到對(duì)應(yīng)目錄 python -m http.server 80
注意:python 要3.0+ 80 是端口
5.案例
C:\Users\KZGGM3\Desktop\share>python -m http.server 80
Serving HTTP on :: port 80 (http://[::]:80/) ...
::ffff:10.148.162.224 - - [03/Nov/2022 11:24:10] "GET / HTTP/1.1" 200 -
::ffff:10.148.162.224 - - [03/Nov/2022 11:24:10] code 404, message File not found
::ffff:10.148.162.224 - - [03/Nov/2022 11:24:10] "GET /favicon.ico HTTP/1.1" 404 -
python 配置環(huán)境變量
用戶(hù)變量-path:
C:\Users\KZGGM3\AppData\Local\Programs\Python\Python310
C:\Users\KZGGM3\AppData\Local\Programs\Python\Python310\Scripts
系統(tǒng)變量-path
C:\Users\KZGGM3\AppData\Local\Programs\Python\Python310
C:\Users\KZGGM3\AppData\Local\Programs\Python\Python310\Scripts