나는 많은 조합을 찾기 위해 itertools.combinations 모듈을 사용하고 있습니다. 내 프로그램이 모든 조합 (많은 프로그램)을 찾으면 모든 조합의 합계를 확인한 다음 프로그램을 조합하여 목록에 저장합니다.파이썬에서 진행률 표시 줄 및 조합
from itertools import *
from math import *
import Tkinter as tk
import ttk
x = int(raw_input('Enter number of combinations: '))
z = int(raw_input('Enter sum number: '))
def combinator():
comb = combinations(range(100), x)
for i in comb:
yield i
my_combinations = []
combination_s = combinator()
for i in combination_s:
print i
c = list(i)
if fsum(c)==z:
my_combinations.append(c)
print my_combinations
root = tk.Tk()
root.title('ttk.Progressbar')
pbar = ttk.Progressbar(root, length=300, mode='determinate', maximum = 100)
pbar.pack(padx=5, pady=5)
root.mainloop()
프로그램에서 조합의 합계를 계산할 때마다 진행률을 표시하는 ttk.progressbar가 필요합니다. 어떻게해야합니까?
대신
ProgBarApp.start
에서 루프에 대한 몇 가지 계산을 할 변경할 수 있습니다. 여기서 오기 전에 뭔가를 시도해야합니다. –코드 – Domagoj
을 추가했으나 진행 상황을 어떻게 연결할지 모릅니다. – Domagoj