我是pyqt的新手.我正在做一个程序,允许您点击图片并记住您点击的点的坐标,并在GUI的小部件上绘制一个图形.我的代码现在可以提示一个新窗口显示一个4点的多边形.但是,我希望它可以显示在我由pyqt所做的ui文件上.窗口小部件的对象名称称为widget.我希望有人可以帮我修改代码,在gui小部件上显示多边形而不提示出新窗口.
非常感谢!!!
import sys
from PyQt4.QtCore import *
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import *
from Main_window import *
global imgloc
imgloc = "1.jpg"
array = []
clicks = 0
class MyForm(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.local_image = QImage(imgloc)
self.imageLocation = imgloc
self.local_scene = QGraphicsScene()
self.pixMapItem = QGraphicsPixmapItem(QPixmap(self.local_image), None, self.local_scene)
self.ui.graphicsView_5.setScene( self.local_scene )
self.pixMapItem.mousePressEvent = self.pixelSelect
def pixelSelect(self,event):
global imgloc
a = event.pos().x()
b = event.pos().y()
global clicks
global array
if clicks != …Run Code Online (Sandbox Code Playgroud) 我有这样的表数据:
<table class="tablesorter" id="dea">
<thead>
<tr>
<th class="header ">Name</th>
<th class="header">City</th>
<th class="">Address</th>
<th class="">Phone Nos</th>
<th class="">Email</th>
<th class="">Fax</th>
</tr>
</thead>
<tbody>
<tr class="info">
<td style="font:bold 12px Tahoma; color:#1f2c48;">Audi California</td>
<td> California </td>
<td align="left">
A?85, bay Area, Phase 1, <br>
California<br>
California
- 6554655
</td>
<td align="right">
<br>4747744747<br>108388383
</td>
<td align="center">
info<!-- >@_ -->@<!-- >@_ -->audiCal<!-- >@_ -->.<!-- >@_ -->net
</td>
<td align="right">
</td>
</tr></tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
我正在使用beautifulsoup来解析这个问题,但现在我从最后四个数据中获取数据时遇到了问题<td>.每当我使用.string属性读取它们的值时,我都会得到None它的价值.我想这是因为他们有<br>标签.我想要最后四个<td>有地址的数据,电话号码,email_id和传真.而不是.string我应该使用什么来获取所有这些数据?
测试行是否存在非常简单.
if exists(select * from dbo.APQP_head where zestaw=@zestaw)
Run Code Online (Sandbox Code Playgroud)
我想在我的查询中测试是否所有行都满足条件.
我需要使用这样的一些查询
if All exists(select * from dbo.APQP_head where zestaw=@zestaw and type=3)
Run Code Online (Sandbox Code Playgroud)
但是这种语法不正确.
我是xcode的新手.我有一个字符串变量和一个文本框.我想从文本框中获取字符串到字符串变量.我怎样才能做到这一点?
环境:CentOS6.4,python2.6我创建了一个virtualenv(envflask)并激活它,然后pip安装烧瓶,一切都还可以!但是在创建了另一个virtualenv(envuwsgi)并激活它后,我没有pip install uwsgi,错误消息是:
...
plugins/python/python_plugin.c:1731: ?????????‘<erroneous-expression>’??????
plugins/python/python_plugin.c:1731: ?????????
plugins/python/python_plugin.c: ???‘uwsgi_python_harakiri’?:
plugins/python/python_plugin.c:1737: ???‘struct uwsgi_python’????‘tracebacker’???
plugins/python/python_plugin.c:1740: ???‘struct uwsgi_python’????‘tracebacker’???
plugins/python/python_plugin.c:1740: ?????‘uwsgi_concat2’?? 1 ????????????????
plugins/python/../../uwsgi.h:2733: ???????‘char *’????????‘struct uwsgi_option *’
plugins/python/python_plugin.c: ???‘uwsgi_python_logger’?:
plugins/python/python_plugin.c:1768: ???‘struct uwsgi_python’????‘gil_get’???
plugins/python/python_plugin.c:1768: ?????????‘<erroneous-expression>’??????
plugins/python/python_plugin.c:1768: ?????????
plugins/python/python_plugin.c:1771: ???‘PyObject’???(??????????)
plugins/python/python_plugin.c:1771: ???‘py_logging’???(??????????)
plugins/python/python_plugin.c:1771: ???????? * ???(‘struct uwsgi_option *’?‘struct uwsgi_option *’)??
plugins/python/python_plugin.c:1771: ?????????
plugins/python/python_plugin.c:1773: ???‘py_logging_dict’???(??????????)
plugins/python/python_plugin.c:1773: ???????? * ???(‘struct uwsgi_option *’?‘struct uwsgi_option *’)??
plugins/python/python_plugin.c:1773: ?????????
plugins/python/python_plugin.c:1775: ???‘py_getLogger’???(??????????)
plugins/python/python_plugin.c:1775: ???????? * ???(‘struct uwsgi_option *’?‘struct uwsgi_option *’)??
plugins/python/python_plugin.c:1775: ?????????
plugins/python/python_plugin.c:1777: ???‘py_getLogger_args’???(??????????)
plugins/python/python_plugin.c:1777: ???????? * ???(‘struct uwsgi_option *’?‘struct …Run Code Online (Sandbox Code Playgroud) python ×3
drawing ×1
exists ×1
html-parsing ×1
iphone ×1
objective-c ×1
pyqt ×1
sql ×1
uwsgi ×1
xcode ×1