nohup后台运行Python程序无log输出的问题 分类:Python 阅读 (4,510) No Responses » 7月 142015 使用nohup命令运行一个Python程序时,只生成了nohup.out文件,但是print的内容却都没有保存到nohup.out中,使用的命令如下: nohup python3.4 tcpserver.py 1 nohup python3.4 tcpserver.py 经过在网上查询,需要在python命令后加一个-u参数才可以,正确的命令如下: nohup python3.4 -u tcpserver.py 1 nohup python3.4 -u tcpserver.py