Hello,
I need a basic, standalone web server with support for directory listing.
Windows' antivirus blocks Mongoose ("Trojan Win32 Wacatac.B!ml"), and neither Ritlabs Tinyweb server, Rebex Tiny Web Server, nor micro_httpd/mini_httpd provide the same features.
So I tried PyInstaller to create a standalone binary… but it fails:
www.py:
Thank you.
--
Edit: An infinite loop is the way to go:
I need a basic, standalone web server with support for directory listing.
Windows' antivirus blocks Mongoose ("Trojan Win32 Wacatac.B!ml"), and neither Ritlabs Tinyweb server, Rebex Tiny Web Server, nor micro_httpd/mini_httpd provide the same features.
So I tried PyInstaller to create a standalone binary… but it fails:
www.py:
#ipconfig #how to display computer's IP address so user knows? python -m http.server 8080 pip install -U pyinstaller pyinstaller www.py Syntax error in c:\temp\www.py File "c:\temp\www.py", line 2 python -m http.server 8080 ^^^^ SyntaxError: invalid syntaxWhat's the right way to get a working binary?
Thank you.
--
Edit: An infinite loop is the way to go:
from http.server import HTTPServer, SimpleHTTPRequestHandler #to listen on 192.168 addr = ("0.0.0.0", 8080) print("Listening on " + str(addr)) httpd = HTTPServer(addr, SimpleHTTPRequestHandler) httpd.serve_forever() #netstat -ao | grep ^.LISTENING"Note: PyInstaller doesn't create a single binary, standalone application: To run, the EXE requires a sub-directory (_internal) with several files:
- base_library.zip
- libcrypto-3.dll
- libssl-3.dll
- python312.dll
- select.pyd
- unicodedata.pyd
- VCRUNTIME140.dll
- _bz2.pyd
- _decimal.pyd
- _hashlib.pyd
- _lzma.pyd
- _socket.pyd
- _ssl.pyd