一条python语句搭建http服务器,实现局域网数据下载

一、Python 2.x

当前目录有文件:

http.txt

命令:

python -m SimpleHTTPServer 8888

Serving HTTP on 0.0.0.0 port 8888 ...

默认占用 8000 端口。

二、Python 3.x

当前目录有文件:

http.txt

命令:

python -m http.server 8888

Serving HTTP on 0.0.0.0 port 8888 ...

默认占用 8000 端口。

三、局域网下载文件

通过curl命令下载到本地

curl -o http.txt http://x.x.x.x:8888/http.txt

相关推荐
tod1133 分钟前
Reactor反应堆模式
网络·网络协议·tcp/ip·reactor·多路转接·tcpdump
IT研究所8 小时前
IT 资产管理 (ITAM) 与 ITSM 协同实践:构建从资产到服务的闭环管理体系
大数据·运维·人工智能·科技·安全·低代码·自动化
Codefengfeng8 小时前
分辨压缩包的真加密与伪加密
linux·运维·网络
014.8 小时前
2025最新jenkins保姆级教程!!!
java·运维·spring boot·spring·jenkins
leifengzhy8 小时前
Jenkins使用pipeline和maven创建项目
运维·jenkins·maven
白太岁8 小时前
通信:(3) 高并发网络通信:epoll + 边沿触发 + 非阻塞 IO + tcp
c语言·网络·c++·网络协议·tcp/ip
码农阿豪8 小时前
Jenkins Git 克隆失败深度解析:从 “Connection reset by peer“ 到彻底解决
运维·git·jenkins
暴力求解8 小时前
Linux---进程(五)进程调度
linux·运维·服务器
wsad05328 小时前
Linux 用户和组管理完整指南(中英文参数对照)
linux·运维·服务器
EmbedLinX9 小时前
嵌入式Linux之U-Boot
linux·服务器·笔记·学习