我得到了这段代码,我需要滚动条,我尝试搜索如何在 stackoverflow 上添加它(ScrolledWindow with tix...),但我仍然无法得到正常工作的东西。有人可以帮助我吗?
\n\nfrom tkinter import *\nfrom random import randint\n\nroot = Tk()\nroot.title("Quiz")\nroot.geometry("400x300")\n\n\nclass Window:\n\n def __init__(self, question, answer):\n self.text = [question, answer]\n self.createLabel()\n # self.createText()\n self.createEntry()\n self.createButton()\n\n def retrieve_input(self):\n # inputValue = self.textBox.get("1.0", "end-1c")\n # print(inputValue)\n if self.mystring.get() == self.text[1]:\n print("Esatto. \xc3\xa8 " + self.text[1])\n self.left[\'text\'] = "Esatto"\n\n def createLabel(self):\n self.labelframe = LabelFrame(root, text="Domanda:")\n self.labelframe.pack(fill="both", expand="yes")\n self.left = Label(self.labelframe, text=self.text[0])\n self.left.pack()\n\n def createText(self):\n self.textBox = Text(height=1)\n self.textBox.pack()\n\n def createEntry(self):\n self.mystring = StringVar()\n self.myentry = Entry(root, textvariable=self.mystring).pack()\n\n …Run Code Online (Sandbox Code Playgroud) 我尝试以不同的延迟加入两个不同的 gif,但最终的 output.gif 具有相同的延迟,而不是不同...有没有办法在一个 gif 中具有不同的延迟?
import subprocess
import os
def mk(i, o, delay=100):
subprocess.call("convert -delay " +
delay + " -loop 5 " + i + " " + o, shell=True)
delay = input("Delay (default 100): ")
# mk("*png", "gif1, delay) # I used this to make the 2 gif
# with a delay of 100 and 30 respectively
# and then I joined them with the code below, but I dunno how to
# give them a separate …Run Code Online (Sandbox Code Playgroud)