我正在制作一个代码模拟一个围绕垄断板的棋子一百万次.我希望有一个tqdm进度条,每次转盘时都会更新.
以下是我目前的代码.我正在使用while循环,当电路板周围的转数超过所需数量时,它会停止.
import os
from openpyxl import Workbook
from monopolyfct import *
def main(runs, fileOutput):
### EXCEL SETUP ###
theWorkbook = Workbook() # Creates the workbook interface.
defaultSheet = theWorkbook.active # Creates the used worksheet.
currentData = ["Current Table Turn", "Current Tile"] # Makes EXCEL column titles.
defaultSheet.append(currentData) # Appends column titles.
### CONTENT SETUP ###
currentData = [1, 0] # Sets starting position.
defaultSheet.append(currentData) # Appends starting position.
while currentData[0] <= runs:
### ROLLING THE DICES PROCESS ### …Run Code Online (Sandbox Code Playgroud)