python-3.2

    0热度

    1回答

    我已经创建了一个程序,要求用户输入给定的TimeType(Seconds/Minutes)和objectivetime(integer)(例如,如果用户输入秒数然后是5,则目标时间是5秒)。另外,该程序还会在开始时检查时间,然后检查后面的时间以计算出elapsed_time。然后我想检查elapsed_time是否大于或等于objective time。我已经写了如下所示的代码(减去a之间b其他不

    1热度

    1回答

    在.../CthuluPackage 在CthuluCore.py,我有: class Dice(object): @staticmethod def __RollSkillMenu(): bonus=int(input("Bonus>")) penalty=int(input("Penalty>")) return Dice.RollSki

    1热度

    2回答

    这是一个错误?它演示了使用libtiff从打开的tiff文件句柄提取图像时会发生什么。它的工作原理在Python 2.x和在Python 3.2.3 import os # any file will work here, since it's not actually loading the tiff # assuming it's big enough for the seek fil

    0热度

    2回答

    所以我做饼干唱首歌的Python版本:d 到CPS添加到饼干柜台,我用这个代码: while True: cps = b1*1 + b2*5 + b3*10 + b4*20 + b5*25 c=c+cps time.sleep(60) print('you now have %s cookies' %c) 注:B1,B2等不同的cookie的数量生产者

    0热度

    1回答

    的Python系列进口 当我想用串行库,我得到这个错误: $ ./console.py Traceback (most recent call last): File "./console.py", line 7, in import serial ImportError: No module named serial 我的Cygwin在Windows7 $ uname -a CYGWIN_NT-

    0热度

    2回答

    原始代码: >>> def calcItemsLowShelfLife(shelfLifeList): ctLowShelfLife = 0 for number in shelfLifeList: if number <= 7: ctLowShelfLife += 1 return ctLowShelfLife >>> shelfLife

    0热度

    1回答

    我有这段代码(类似于前一段代码)。它应该只扫动50度,然后停止并向右扫动100度,然后停止并向左扫动100度,等等。唯一的问题是它停在左边,向右走,然后继续向右走,尽管我在那里停下来阻止发生。 try: screen.blit(Turrets[1], (TurretCoords[1])) if Rotation == 1: print(

    0热度

    2回答

    我有以下代码: class CounterIDHandler(RequestHandler): @gen.coroutine def get(self, counter_id): try: object_id = bson.objectid.ObjectId(counter_id) except bson.errors.InvalidId

    -4热度

    3回答

    编写一个python程序。所有相邻的副本。例如,如果输入是 1 3 3 4 5 5 6 6 6 2, 程序应该打印3 5 6 这是我迄今为止: print("Take out repeating numbers") def main(): a = int(input("Enter a number: ")) b = int(input("Enter a number: "

    -2热度

    2回答

    我是python的初学者。我的问题是在使用python编译项目时,如何使用户输入变量成为属性。 例如: class supermarket: num=int(input('enter a no.')) def __init__(self,num): self.ini='' def odd_even(self,num): if num%