1(reg)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\1Python SimpleHTTPServer]
@="SimpleHTTPServer"
"Icon"="%SystemRoot%\\system32\\shell32.dll,-14"
[HKEY_CLASSES_ROOT\Directory\Background\shell\1Python SimpleHTTPServer\command]
@="cmd /c \"start http://localhost/\"&&python.exe -m http.server 80"
2(cmd/bat)
start http://localhost/
python.exe -m http.server 80
3(reg)注意此处最后一行是2的文件位置
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\1Python SimpleHTTPServer]
@="SimpleHTTPServer"
"Icon"="%SystemRoot%\\system32\\shell32.dll,-14"
[HKEY_CLASSES_ROOT\Directory\Background\shell\1Python SimpleHTTPServer\command]
@="\"C:\\Users\\Administrator\\Desktop\\SimpleHTTPServer.bat\""
全部运行即可
找到相应版本python的目录
C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Lib\wsgiref
打开simple_server.py文件 把这个替换掉速度就上来了
#host = self.address_string()
host = ""
使用的时候右键要分享文件夹的空白处,点击simplehttpserver就打开一个cmd和网页
不想打开网页把cmd的第一句话去掉即可
局域网内设备直接输入IP地址即可查看和下载文件
通过注册表编辑和批处理文件设置,实现Python简易HTTP服务器快速部署。只需右键点击文件夹背景即可启动服务,并在局域网内通过IP地址访问。
1366

被折叠的 条评论
为什么被折叠?



