0

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

    import time
    print ( "loading cakes.. please wait")
    time.sleep(3)
    print ("cakes now loaded - enjoy your program")
    time.sleep(1)

    print ( "Enter a People Name" )
    name = (input())

    print ( "Enter Years of a People, I'll tell you the Years in Doggo : ", end = "")
    ppl = float(input())

    doggo = ppl * 7


    print (name, "Is a People, with a People Years of", ppl, )
    print (name,"'s Age in People Years is", ppl, " and is equal to", doggo, "Doggo Years " )
    time.sleep(2)
    print("(・・;) you're so old") 

东西的图片

我认为这并不重要,但我们将不胜感激。

4

1 回答 1

0

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

编辑,抱歉在评论中填充代码。(我的版本是 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") 
于 2017-01-24T20:27:31.267 回答