Control a web server directly from Notepad++ using Python scripts. Serve files from your current directory and manage the server via console commands.
Get up and running with WebServerNpp in minutes!
- Start/stop server with a simple command.
- Automatic detection of available ports (default: 8000).
- Serves files from the active file's directory.
- Server status displayed in the status bar.
- Automatically opens HTML files in the browser.
- Notepad++ installed.
- Python Script plugin installed. (python 2.7)
- Download the latest release from: https://github.com/bruderstein/PythonScript/releases (python 2.7)
- Manual Installation:
- Extract the
.zip
file. - Copy
PythonScript.dll
to:Notepad++\plugins\PythonScript
- Restart Notepad++
- Extract the
- Copy
startup.py
andWebServerNpp.py
to:Notepad++\plugins\PythonScript\scripts
- Restart Notepad++
-
Open the Python Console:
Plugins -> Python Script -> Show Console
-
Available commands:
startws()
- Starts the server in the current directorystartws()
stopws()
- Stops the serverstopws()
statusws()
- Displays the server statusstatusws()
refreshws()
- Restarts the serverrefreshws()
To change the default port:
- Edit
WebServerNpp.py
- Modify the
DEFAULT_PORT
variable.DEFAULT_PORT = 8080 # Example: Change to port 8080
To adjust the number of port attempts:
- Modify the
MAX_PORT_ATTEMPTS
variable inWebServerNpp.py
.MAX_PORT_ATTEMPTS = 10 # Example: Change to 10 attempts
- Developed and tested on Windows 10.
- Requires the Notepad++ APIs.
- Python Script Errors: Verify the plugin installation. Ensure
PythonScript.dll
is in the correct directory. - Port Conflicts: The script automatically searches for available ports. If you consistently encounter issues, consider changing the
DEFAULT_PORT
.
Open-source (MIT). Contributions are welcome! See the LICENSE file for more information.