forked from GithubMirrors/cardconjurer
Added webbrowser.open to server
This commit is contained in:
2
serve.py
2
serve.py
@@ -1,5 +1,6 @@
|
|||||||
# Python 3 server example
|
# Python 3 server example
|
||||||
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
||||||
|
import webbrowser
|
||||||
import os
|
import os
|
||||||
|
|
||||||
NAME = "localhost"
|
NAME = "localhost"
|
||||||
@@ -16,6 +17,7 @@ if __name__ == "__main__":
|
|||||||
print("Server started http://%s:%s" % (NAME, PORT))
|
print("Server started http://%s:%s" % (NAME, PORT))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
webbrowser.open('http://localhost:8080', new=2)
|
||||||
webServer.serve_forever()
|
webServer.serve_forever()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user