我想在新窗口打开html文件,按下按钮。
但我做不到。请指教。
的index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<body>
<form action="./cgi-bin/openNewWindow.py" method="POST">
<input type="submit">
</form>
</body>
</html>
openNewWindow.py
#!/usr/bin/env python
# coding: UTF-8
print("Content-type: text/html")
print("""
<!DOCTYPE html><html><head>
<meta charset="utf-8">
<title>new window</title>
</head><body>
<h1>new window</h1>
</body></html>
""")
cgiserver.py
#!/usr/bin/env python
# coding: UTF-8
import http.server
http.server.test(HandlerClass=http.server.CGIHTTPRequestHandler)