
下pygame module,然后
import pygamepygameinit()
screen = pygamedisplayset_mode([100,100]) ##size of window
your_image = pygameimageload("your_image_namepng") ## image must be in the same folder, else path must be specified
while 1:
screenblit(your_image,[0,0]) ##pos of your image on the window
for event in pygameeventget():
if eventtype == pygameQUIT:
exit()
position = pygamemouseget_pos() ##position of mouse on window
print position
pygamedisplayset_caption(str(position)) ##make it the title of the window
pygamedisplayflip()
调用百度地图接口爬取各城市小区基本信息
调用接口:
Place APIWeb服务API
Geocoding APIWeb服务API url:>
以上就是关于python 获取鼠标在图片上的坐标全部的内容,包括:python 获取鼠标在图片上的坐标、python怎么根据地名爬取百度坐标、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)