Python 局域网内文件共享

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地址即可查看和下载文件

猜你喜欢

转载自blog.csdn.net/qq_41863100/article/details/118219263