1、程序後臺運行
nohup python test.py > tt.log>&1 &
2、不能及時輸出日誌
nohup.out中顯示不出來python程序中print的東西,這是因爲python的輸出有緩衝,導致nohup.out並不能夠馬上看到輸出。
python 有個-u參數,使得python不啓用緩衝。
nohup python -u test.py>tt.log>&1 &
1、程序後臺運行
nohup python test.py > tt.log>&1 &
2、不能及時輸出日誌
nohup.out中顯示不出來python程序中print的東西,這是因爲python的輸出有緩衝,導致nohup.out並不能夠馬上看到輸出。
python 有個-u參數,使得python不啓用緩衝。
nohup python -u test.py>tt.log>&1 &
1.while循環的格式 while 條件: 條件滿足時,做的事情1 條件滿足時,做的事情2 條件滿足時,做的事情3 ...(省略)... demo