程序在启动和重启时崩溃

时间:2017-01-24 20:23:30

标签: python-3.x sleep-mode

我的程序运行正常,但有时在启动时会停止吗?或崩溃?并立即重新加载。我不知道为什么会这样做。这不是我的错误。 它只在我添加睡眠功能后才开始。

Iterable

picture of the thing

我认为这并不重要,但我们将非常感谢答案。

1 个答案:

答案 0 :(得分:0)

我曾经遇到过这个问题,导致它的是反病毒扫描程序。它暂停了脚本以检查它,然后在清除扫描后重新启动它。

编辑,sry填写评论中的代码。 (我的版本是Python 2.7,但3.x应该是相同的)

#!c:\Python27\python.exe
# -*- coding: utf-8 -*-
import time
print ( "loading cakes.. please wait")
time.sleep(3)
print ("cakes now loaded - enjoy your program")
time.sleep(1)
name = raw_input("Enter a People Name\n")
ppl = float(raw_input("Enter Years of a People, I'll tell you the Years in Doggo : "))
doggo = ppl * 7
print ("%s Is a People, with a People Years of %d" %(name, ppl))
print ("%s's Age in People Years is %d and is equal to %d Doggo Years " %(name, ppl, doggo))
time.sleep(2)
print("(・・;) you're so old")