国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

python 計數(shù) global變量使用

2020-03-10 16:33 作者:一心想當網(wǎng)紅的李老師  | 我要投稿

# -*- coding: utf-8 -*-

"""

Created on Tue Mar 10 14:04:43 2020


@author: liyan

"""

import tkinter

from tkinter import *

from PIL import Image,ImageTk

from tkinter.filedialog import askopenfilename

import time

import CV2

import tkinter as tk

import array

import numpy as np



data=[]

count=0



def getposBgr(event, x, y, flags, param):

? ? if event==CV2.EVENT_LBUTTONDOWN:

? ? ? ? print("Bgr is", img[y, x])

? ? ? ? global count ? ####不定義會報錯。

? ? ? ? count=count+1

? ? ? ? data=img[y, x]

? ? ? ? print(data)

? ? ? ? f=open('data.txt','a')

? ? ? ? info=str(count)+";"+str(data[0])+";"+str(data[1])+";"+str(data[2])+"\n"

? ? ? ? f.write(info)

? ? ? ? f.close()


? ? ??

top=tkinter.Tk()

file_path=askopenfilename()

img = CV2.imread(file_path)

print(img)

HSV = CV2.cvtColor(img, CV2.COLOR_BGR2HSV)

CV2.imshow('image', img)

CV2.setMouseCallback("image", getposBgr)

CV2.waitKey(0)

CV2.destroyAllWindows()

top.mainloop()?


python 計數(shù) global變量使用的評論 (共 條)

分享到微博請遵守國家法律
秦皇岛市| 霍城县| 诸城市| 东宁县| 鹿泉市| 密山市| 荥经县| 青田县| 田林县| 垫江县| 舒城县| 海伦市| 南平市| 天气| 洞头县| 民勤县| 三亚市| 怀仁县| 抚远县| 巍山| 塔河县| 乐平市| 武宁县| 慈溪市| 绥宁县| 定远县| 江津市| 元江| 十堰市| 陈巴尔虎旗| 徐州市| 图片| 汝州市| 牡丹江市| 财经| 海南省| 赞皇县| 海伦市| 水城县| 伽师县| 南康市|