python - 刷新后Http服务器显示相同的页面?
问题描述
我有一段代码用于在http servers
. 我首先做的是设置我的http server in python and type it in my web browser, listening on port
8000 . However when i delete the
index.html and stopped the
python` 脚本并在我的网络浏览器上点击刷新,它仍然显示相同的页面!顺便说一句,我目前正在使用 Firefox 开发者版。
我尝试用index.html
另一个不同的网站替换index.html
它进行测试,但它没有显示新网站。
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print("serving at port", PORT)
httpd.serve_forever()
index.html
我希望网络浏览器在关闭python
脚本后停止显示。请帮助修复我的代码,使其停止显示相同的index.html
解决方案
欢迎来到stackoverflow。我认为您的问题与缓存有关!您可以尝试ctrl+f5
在浏览器上点击以查看它是否有效。
推荐阅读
- python - Scape gtag/jquery 变量与 BeautifulSoup?
- android-studio - 无法在不继承旧项目的情况下将项目添加到 arrayList
- oracle - 无法使用触发器绕过 ORA-04091(变异表)
- python - 在 ColumnTransformer 转换期间合并 scikit 中的行
- android - 清单合并失败:需要明确指定 android:exported
. 在 Jetpack Compose 项目中 - r - 计算时间平均值时 get(as.character(FUN), mode = "function", envir = envir) 出错
- kubernetes - 在 Kubernetes 上实现 Dask 工作人员覆盖默认值
- c# - 从 OperationContext.Current.RequestContext.RequestMessage 接收 JSON
- r - 在一个闪亮的应用程序中创建多个时间线
- javascript - 在 Vue JS 中渲染 Markdown