我想知道当我在PyCharm中检查opencv的源代码时为什么会有所有“通过”语句吗?

时间:2019-03-24 02:32:00

标签: opencv

import tkinter as tk

winH = 400
winW = 400
ncols = 10
nrows = 10
cellW = winW / ncols
cellH = winH / nrows

class Node:
    def __init__(self, row, col):
        self.row = row
        self.col = col
        return

def generatGrid(nrows, ncols):
    grid = []
    for r in range(nrows):
        row = [ Node(r, c) for c in range(ncols) ]
        grid.append(row)
    return grid

def drawNode(canvas, node):
    x1 = cellW * node.col
    y1 = cellH * node.row
    x2 = x1 + cellW
    y2 = y1 + cellH
    canvas.create_rectangle(x1, y1, x2, y2)
    return

def drawGrid(canvas, grid):
    for row in grid:
        for node in row:
            drawNode(canvas, node)
    return

window = tk.Tk()
canvas = tk.Canvas(window, width=winW, height=winH)
canvas.pack()

grid = generatGrid(nrows, ncols)
drawGrid(canvas, grid)

window.mainloop()

为什么所有的“通过”语句都存在?我想知道该功能是如何具体实现的。

0 个答案:

没有答案