【发布时间】:2013-05-15 16:16:48
【问题描述】:
我有这个脚本,我不知道如何让它在后台运行,因为当我关闭会话时它也会关闭。我尝试将其放在 crontab 上,但找不到 index.html 并在 / 中显示文件列表。
#! /opt/python3/bin/python3
from http.server import HTTPServer, CGIHTTPRequestHandler
port = 8000
httpd = HTTPServer(('', port), CGIHTTPRequestHandler)
print("Starting simple_httpd on port: " + str(httpd.server_port))
httpd.serve_forever()`
【问题讨论】:
标签: python python-3.x