关于自动回车和时间设置问题,谢谢!
import os
import time
comment = raw_input('Enter a comment --> ')
if len(comment) != 0: # check if a comment was entered
print "Ok,you input something in 60s"
print "You input comment is",comment
os.system("eject")
我的目的是需要用户在60秒内输入内容,然后直接显示if中内容,然后弹出光盘,如果60秒内没有输入内容,到达60秒时,也弹出光盘.
我这是一个python脚本,需要加入crontab文件中自动运行,请问这个时间应该怎么设置,还有60秒后这个"自动回车"应该怎么产生,谢谢指教!