Python截图比对,操作鼠标键盘(mhxysy实例)

import sys import win32gui from PyQt5.QtWidgets import QApplication import numpy import cv2 from pathlib import Path from ctypes import windll, byref from ctypes.wintypes import HWND, POINT import time

zjb = [] hld = win32gui.FindWindow(None, u"BlueStacks App Player") print('主窗口ID', hld) win32gui.EnumChildWindows(hld, lambda aa, bb: bb.append(aa), zjb) print('子窗口ID', zjb) print(zjb[1])

通过句柄获取窗口的左、上、右、下,位置

left, top, right, bottom = win32gui.GetWindowRect(zjb[1]) print(left, top, right, bottom)

----------------------------------------------------------后台鼠标键盘操作

PostMessageW = windll.user32.PostMessageW ClientToScreen = windll.user32.ClientToScreen WM_MOUSEMOVE = 0x0200 WM_LBUTTONDOWN = 0x0201 WM_LBUTTONUP = 0x202 WM_MOUSEWHEEL = 0x020A WHEEL_DELTA = 120

def move_to(handle: HWND, x: int, y: int): """移动鼠标到坐标(x, y)

1Args: 2 handle (HWND): 窗口句柄 3 x (int): 横坐标 4 y (int): 纵坐标 5""" 6# https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-mousemove 7wparam = 0 8lparam = y << 16 | x 9PostMessageW(handle, WM_MOUSEMOVE, wparam, lparam)

def left_down(handle: HWND, x: int, y: int): """在坐标(x, y)按下鼠标左键

1Args: 2 handle (HWND): 窗口句柄 3 x (int): 横坐标 4 y (int): 纵坐标 5""" 6# https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondown 7wparam = 0 8lparam = y << 16 | x 9PostMessageW(int(handle), int(WM_LBUTTONDOWN), int(wparam), int(lparam))

def left_up(handle: HWND, x: int, y: int): """在坐标(x, y)放开鼠标左键

1Args: 2 handle (HWND): 窗口句柄 3 x (int): 横坐标 4 y (int): 纵坐标 5""" 6# https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttonup 7wparam = 0 8lparam = y << 16 | x 9PostMessageW(int(handle), int(WM_LBUTTONUP), int(wparam), int(lparam))

-------------------------------------------区域找图,识别截图并返回坐标

class Image: def init(self, image): self.image = cv2.imread(image, cv2.IMREAD_UNCHANGED)

1@property 2def width(self): 3 return self.image.shape[1] 4 5@property 6def height(self): 7 return self.image.shape[0]

class MatchImg(object): def init(self, source, template, threshod=0.95): """ 匹配一个图片,是否是另一个图片的局部图。source是大图,template是小图。即判断小图是否是大图的一部分。 :param source: :param template: :param threshod: 匹配程度,值越大,匹配程度要求就越高,最好不要太小 """ self.source_img = source self.template_img = template self.threshod = threshod

1def match_template(self, method=cv2.TM_CCOEFF_NORMED): 2 """ 3 返回小图左上角的点,在大图中的坐标。 4 :param method: 5 :return: list[tuple(x,y),...] 6 """ 7 try: 8 result = cv2.matchTemplate(self.source_img.image, self.template_img.image, method) 9 locations = numpy.where(result >= self.threshod) 10 res = list(zip(locations[1], locations[0])) # 返回的是匹配到的template左上角那个坐标点在image中的位置,可能有多个值 11 return res 12 except cv2.error as e: 13 print(e) 14 15def get_template_position(self): 16 """ 17 获取小图在大图中,左上角和右下角的坐标 18 :return: List[list[x,y,x,y],...] 19 """ 20 res = self.match_template() 21 new_pos = [] 22 for r in res: 23 r = list(r) 24 r.append(r[0]+self.template_img.width) 25 r.append(r[1]+self.template_img.height) 26 new_pos.append(r) 27 return new_pos 28 29def get_img_center(self): 30 """ 31 获取大图中,每个小图中心点所在的坐标 32 :return: 33 """ 34 pos = self.match_template() 35 points = [] 36 for p in pos: 37 x, y = p[0]+int(self.template_img.width/2), p[1]+int(self.template_img.height/2) 38 points.append((x, y)) 39 return points

def load_image_file(path): path = Path(path) if not path.exists(): print('not exist file') try: image = Image(str(path)) return image except cv2.error as e: print(e)

pyautogui.PAUSE = 1

im = pyautogui.screenshot() # 前台全屏截图

可把窗口遮挡截图并保存

#----------------------------------------------------以下为登录和角色选择------------------------------------------------

def jbdy(canshu): # 自定义类时,需要引号

app = QApplication(sys.argv) screen = QApplication.primaryScreen() xhcs = 0 while xhcs<4: for canshu in range(1, 7): # 此处1-7可以登陆6个账号重复循环 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\dl.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() if points==[]: ii = 0 while points==[]: # 如果返回的坐标为空,继续循环查找 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\dl.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() ii+=1 if ii>100: print('没有') exit() # exit()和quit()都是直接退出程序 # points1 = process.get_template_position() # print(points1) # 找到图的左上角和右下角的坐标 print(points, '登录') # 找到图的中心点坐标 print(points[0][0], points[0][1]) left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(0.1) left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(3) # 不知道为什么要减40,但是减去40就可以正确点击 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\fwq.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() if points==[]: ii = 0 while points==[]: # 如果返回的坐标为空,继续循环查找 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\fwq.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() ii+=1 if ii>100: print('没有') exit() # exit()和quit()都是直接退出程序 # points1 = process.get_template_position() # print(points1) # 找到图的左上角和右下角的坐标 print(points, '选择服务器') # 找到图的中心点坐标 print(points[0][0], points[0][1]) left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(0.1) left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(10) img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\js'+str(canshu)+'.bmp') # 路径字符中有变量的写法。6个角色的选择,给角色图片编上号 process = MatchImg(img1, img2, 0.9) points = process.get_img_center() if points==[]: ii = 0 while points==[]: # 如果返回的坐标为空,继续循环查找 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jt.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jt.bmp') img2 = load_image_file(r'D:\findpic\js'+str(canshu)+'1.bmp') # 路径字符中有变量的写法 process = MatchImg(img1, img2, 0.9) points = process.get_img_center() ii+=1 if ii>100: print('没有') exit() # exit()和quit()都是直接退出程序 # points1 = process.get_template_position() # print(points1) # 找到图的左上角和右下角的坐标 print(points, '选择角色') # 找到图的中心点坐标 print(points[0][0], points[0][1]) left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(0.1) left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 time.sleep(6) #-------------------------------------------以上为登录和角色选择-------------------------------------------------------- #-----------------------------------------------以下为运镖任务--------------------------------------------- img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jietu.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jietu.bmp') img2 = load_image_file(r'D:\findpic\hd.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() if points==[]: ii = 0 while points==[]: # 如果返回的坐标为空,继续循环查找 img = screen.grabWindow(hld).toImage() img.save(r'D:\findpic\jietu.bmp') time.sleep(2) img1 = load_image_file(r'D:\findpic\jietu.bmp') img2 = load_image_file(r'D:\findpic\hd.bmp') process = MatchImg(img1, img2, 0.9) points = process.get_img_center() ii+=1 if ii>100: print('没有') exit() # exit()和quit()都是直接退出程序

1 print(points, '点活动--运镖') # 找到图的中心点坐标 2 points1 = process.get_template_position() 3 print(points1) # 找到图的左上角和右下角的坐标 4 print(points[0][0], points[0][1]) 5 left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 6 time.sleep(0.1) 7 left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 8 time.sleep(3) 9 img = screen.grabWindow(hld).toImage() 10 img.save(r'D:\findpic\jietu.bmp') 11 time.sleep(2) 12 img1 = load_image_file(r'D:\findpic\jietu.bmp') 13 img2 = load_image_file(r'D:\findpic\ybrw.bmp') 14 process = MatchImg(img1, img2, 0.9) 15 points = process.get_img_center() 16 if points==[]: 17 ii = 0 18 while points==[]: # 如果返回的坐标为空,继续循环查找 19 img = screen.grabWindow(hld).toImage() 20 img.save(r'D:\findpic\jietu.bmp') 21 time.sleep(2) 22 img1 = load_image_file(r'D:\findpic\jietu.bmp') 23 img2 = load_image_file(r'D:\findpic\ybrw.bmp') 24 process = MatchImg(img1, img2, 0.90) 25 points = process.get_img_center() 26 ii+=1 27 print('重试' + str(ii)) 28 if ii>100: 29 print('没有') 30 exit() # exit()和quit()都是直接退出程序 31 print(points) # 找到图的中心点坐标 32 points1 = process.get_template_position() 33 print(points1, '点击运镖') # 找到图的左上角和右下角的坐标 34 #--------------------------------------------------------------------- 35 i=120 36 j=35 # 不知道为什么坐标位置,始终有点差别 37 print(points1[0][2]) 38 print(points1[0][3]) 39 left_down(zjb[1], points1[0][2]+i, points1[0][3]-j) # 此处我们按下的点是:横坐标为返回右下角横坐标,纵坐标为返回右下角纵坐标-j 40 time.sleep(0.1) 41 left_up(zjb[1], points1[0][2]+i, points1[0][3]-j) # 此处我们弹起的点是:横坐标为返回右下角横坐标,纵坐标为返回右下角纵坐标-j 42 time.sleep(2) 43 #---------------------------------------------------------------------- 44 img = screen.grabWindow(hld).toImage() 45 img.save(r'D:\findpic\jietu.bmp') 46 time.sleep(3) 47 img1 = load_image_file(r'D:\findpic\jietu.bmp') 48 img2 = load_image_file(r'D:\findpic\ybrw-1.bmp') 49 process = MatchImg(img1, img2, 0.9) 50 points = process.get_img_center() 51 if points==[]: 52 ii = 0 53 while points==[]: # 如果返回的坐标为空,继续循环查找 54 img = screen.grabWindow(hld).toImage() 55 img.save(r'D:\findpic\jietu.bmp') 56 time.sleep(2) 57 img1 = load_image_file(r'D:\findpic\jietu.bmp') 58 img2 = load_image_file(r'D:\findpic\ybrw-1.bmp') 59 process = MatchImg(img1, img2, 0.9) 60 points = process.get_img_center() 61 ii+=1 62 print('重试' + str(ii)) 63 if ii>100: 64 print('没有') 65 exit() # exit()和quit()都是直接退出程序 66 print(points, '接收运镖任务') # 找到图的中心点坐标 67 points1 = process.get_template_position() 68 print(points1) # 找到图的左上角和右下角的坐标 69 left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 70 time.sleep(0.1) 71 left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 72 time.sleep(3) 73 img = screen.grabWindow(hld).toImage() 74 img.save(r'D:\findpic\jietu.bmp') 75 time.sleep(3) 76 img1 = load_image_file(r'D:\findpic\jietu.bmp') 77 img2 = load_image_file(r'D:\findpic\ybrw-2.bmp') 78 process = MatchImg(img1, img2, 0.9) 79 points = process.get_img_center() 80 if points==[]: 81 ii = 0 82 while points==[]: # 如果返回的坐标为空,继续循环查找 83 img = screen.grabWindow(hld).toImage() 84 img.save(r'D:\findpic\jietu.bmp') 85 time.sleep(2) 86 img1 = load_image_file(r'D:\findpic\jietu.bmp') 87 img2 = load_image_file(r'D:\findpic\ybrw-2.bmp') 88 process = MatchImg(img1, img2, 0.9) 89 points = process.get_img_center() 90 ii+=1 91 print('重试' + str(ii)) 92 if ii>100: 93 print('没有') 94 exit() # exit()和quit()都是直接退出程序 95 print(points, '开始运镖') # 找到图的中心点坐标 96 points1 = process.get_template_position() 97 print(points1) # 找到图的左上角和右下角的坐标 98 left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 99 time.sleep(0.1) 100 left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 101 time.sleep(3) 102 img1 = load_image_file(r'D:\findpic\jietu.bmp') 103 img2 = load_image_file(r'D:\findpic\mjxy-tc1.bmp') 104 process = MatchImg(img1, img2, 0.9) 105 points = process.get_img_center() 106 if points == []: 107 ii = 0 108 while points == []: # 如果返回的坐标为空,继续循环查找 109 img = screen.grabWindow(hld).toImage() 110 img.save(r'D:\findpic\jietu.bmp') 111 time.sleep(2) 112 img1 = load_image_file(r'D:\findpic\jietu.bmp') 113 img2 = load_image_file(r'D:\findpic\mjxy-tc1.bmp') 114 process = MatchImg(img1, img2, 0.9) 115 points = process.get_img_center() 116 ii += 1 117 print('重试' + str(ii)) 118 if ii > 100: 119 print('没有') 120 exit() # exit()和quit()都是直接退出程序 121 print(points, '左上角点击打开隐藏按钮') # 找到图的中心点坐标 122 points1 = process.get_template_position() 123 print(points1) # 找到图的左上角和右下角的坐标 124 left_down(zjb[1], points[0][0], points[0][1] - 40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 125 time.sleep(0.1) 126 left_up(zjb[1], points[0][0], points[0][1] - 40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 127 time.sleep(2) 128 img = screen.grabWindow(hld).toImage() 129 img.save(r'D:\findpic\jietu.bmp') 130 time.sleep(3) 131 img1 = load_image_file(r'D:\findpic\jietu.bmp') 132 img2 = load_image_file(r'D:\findpic\mjxy-tc2.bmp') 133 process = MatchImg(img1, img2, 0.9) 134 points = process.get_img_center() 135 if points == []: 136 ii = 0 137 while points == []: # 如果返回的坐标为空,继续循环查找 138 img = screen.grabWindow(hld).toImage() 139 img.save(r'D:\findpic\jietu.bmp') 140 time.sleep(2) 141 img1 = load_image_file(r'D:\findpic\jietu.bmp') 142 img2 = load_image_file(r'D:\findpic\mjxy-tc2.bmp') 143 process = MatchImg(img1, img2, 0.9) 144 points = process.get_img_center() 145 ii += 1 146 print('重试' + str(ii)) 147 if ii > 100: 148 print('没有') 149 exit() # exit()和quit()都是直接退出程序 150 print(points, '点击系统') # 找到图的中心点坐标 151 points1 = process.get_template_position() 152 print(points1) # 找到图的左上角和右下角的坐标 153 left_down(zjb[1], points[0][0], points[0][1] - 40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 154 time.sleep(0.1) 155 left_up(zjb[1], points[0][0], points[0][1] - 40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 156 time.sleep(2) 157 img1 = load_image_file(r'D:\findpic\jietu.bmp') 158 img2 = load_image_file(r'D:\findpic\qhzh.bmp') 159 process = MatchImg(img1, img2, 0.9) 160 points = process.get_img_center() 161 if points==[]: 162 ii = 0 163 while points==[]: # 如果返回的坐标为空,继续循环查找 164 img = screen.grabWindow(hld).toImage() 165 img.save(r'D:\findpic\jietu.bmp') 166 time.sleep(2) 167 img1 = load_image_file(r'D:\findpic\jietu.bmp') 168 img2 = load_image_file(r'D:\findpic\qhzh.bmp') 169 process = MatchImg(img1, img2, 0.9) 170 points = process.get_img_center() 171 ii+=1 172 print('重试' + str(ii)) 173 if ii>100: 174 print('没有') 175 exit() # exit()和quit()都是直接退出程序 176 print(points, '点击切换账号') # 找到图的中心点坐标 177 points1 = process.get_template_position() 178 print(points1) # 找到图的左上角和右下角的坐标 179 left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 180 time.sleep(0.1) 181 left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 182 time.sleep(2) 183 img = screen.grabWindow(hld).toImage() 184 img.save(r'D:\findpic\jietu.bmp') 185 time.sleep(3) 186 img1 = load_image_file(r'D:\findpic\jietu.bmp') 187 img2 = load_image_file(r'D:\findpic\dc.bmp') 188 process = MatchImg(img1, img2, 0.9) 189 points = process.get_img_center() 190 if points==[]: 191 ii = 0 192 while points==[]: # 如果返回的坐标为空,继续循环查找 193 img = screen.grabWindow(hld).toImage() 194 img.save(r'D:\findpic\jietu.bmp') 195 time.sleep(2) 196 img1 = load_image_file(r'D:\findpic\jietu.bmp') 197 img2 = load_image_file(r'D:\findpic\dc.bmp') 198 process = MatchImg(img1, img2, 0.9) 199 points = process.get_img_center() 200 ii+=1 201 print('重试' + str(ii)) 202 if ii>100: 203 print('没有') 204 exit() # exit()和quit()都是直接退出程序 205 print(points, '点击登出') # 找到图的中心点坐标 206 points1 = process.get_template_position() 207 print(points1) # 找到图的左上角和右下角的坐标 208 left_down(zjb[1], points[0][0], points[0][1]-40) # 此处我们按下的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 209 time.sleep(0.1) 210 left_up(zjb[1], points[0][0], points[0][1]-40) # 此处我们弹起的点是:横坐标为返回中心横坐标+i,纵坐标为返回中心坐标的纵坐标 211 time.sleep(10) 212 img = screen.grabWindow(hld).toImage() 213 img.save(r'D:\findpic\jietu.bmp') 214 time.sleep(3) 215 img1 = load_image_file(r'D:\findpic\jietu.bmp') 216 img2 = load_image_file(r'D:\findpic\cxdl.bmp') 217 process = MatchImg(img1, img2, 0.9) 218 points = process.get_img_center() 219 if points==[]: 220 ii = 0 221 while points==[]: # 如果返回的坐标为空,继续循环查找 222 img = screen.grabWindow(hld).toImage() 223 img.save(r'D:\findpic\jietu.bmp') 224 time.sleep(2) 225 img1 = load_image_file(r'D:\findpic\jietu.bmp') 226 img2 = load_image_file(r'D:\findpic\cxdl.bmp') 227 process = MatchImg(img1, img2, 0.9) 228 points = process.get_img_center() 229 ii+=1 230 print('重试' + str(ii)) 231 if ii>100: 232 print('没有') 233 exit() # exit()和quit()都是直接退出程序 234 print(points, '点击红色登录') # 找到图的中心点坐标 235 points1 = process.get_template_position() 236 print(points1) # 找到图的左上角和右下角的坐标 237 left_down(zjb[1], points[0][0], points[0][1]-40) 238 time.sleep(0.1) 239 left_up(zjb[1], points[0][0], points[0][1]-40) 240 time.sleep(50) 241 #---------------------------------------------结束一个账号任务--------------------------------------------------- 242xhcs+=1
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

双十一预售活动分析

2022年双十一促销活动已经开始,大家应该都提前开始关注今年双十一活动的时间表了吧?2022年10月24日晚8:00天猫双11预售时间,第一波销售时间10月31日晚8:0,第二波销售时间11月10日晚8:00;天猫双11的优惠力度是跨店每满30050

Python Challenge Level 18

初学Python,挑战一下流行的PythonChallenge,很不幸,卡在了18关~~被字符字节码之间的转换搞得焦头烂额,不过终于搞定了还是很happy的~~~主要的问题就是16进制形式的字符如何转成字节码(注意:不是encoding)如:\'89','50','4e','47','0d','0a','1a','0a','00

Python3:sqlalchemy对mysql数据库操作,非sql语句

Python3:sqlalchemy对mysql数据库操作,非sql语句python3authorlizmdatetime2018020110:00:00coding:utf8'''