Python变量打印一个额外的空lin

2024-09-27 09:33:27 发布

您现在位置:Python中文网/ 问答频道 /正文

变量currentuser中的空行。我在头骨后面得到一个空行,变量不等于skull,循环继续。你知道吗

currentuser = subprocess.check_output('stat -f%Su /dev/console 2>&1', shell=True)
print currentuser

while not currentuser == "skull":
    time.sleep(1)
    print"waiting for user to login"

print"Script Continue"

头骨后空行

Python/登录日期你知道吗

skull

waiting for user to login
waiting for user to login

Tags: toforoutputcheckloginstatsusubprocess

热门问题