Форум сайта python.su
>>> im = cv.LoadImageM("D:/box.png", cv.CV_LOAD_IMAGE_GRAYSCALE) >>> (keypoints, descriptors) = cv.ExtractSURF(im, None, cv.CreateMemStorage(), (0, 30000, 3, 1)) Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> (keypoints, descriptors) = cv.ExtractSURF(im, None, cv.CreateMemStorage(), (0, 30000, 3, 1)) error
Traceback (most recent call last): File "C:/Users/Jer/PycharmProjects/oc_1/1.py", line 144, in <module> params = cv.SURFParams(500 , 1) AttributeError: 'module' object has no attribute 'SURFParams'
params = cv.SURFParams(500 , 1) cv.ExtraSURF(object,0,objectKeypoints,objectDescriptors,storage, params)
#!/usr/bin/python import matplotlib.pylab as p from numpy import array p.gca().add_patch(p.Polygon([[-2.2,0],[2.2,0],[2.2,3.5],[-2.2,3.5]],facecolor='yellow',alpha=0.5,fill=True,linewidth=1)) W=array([[0,0,2,1],[1,1,2,-2],[-1,1,-2,4]]) p.gca().quiver(W[:,0],W[:,1],W[:,2],W[:,3],color='black') #p.arrow(0,2,0,-1) p.savefig('ttest.eps') p.show()
$ mkvirtualenv --python=/usr/bin/python2.7 kit Running virtualenv with interpreter /usr/bin/python2.7 New python executable in kit/bin/python Installing setuptools........... Complete output from command /Users/ololoev/.virtualenvs/kit/bin/python -c "#!python \"\"\"Bootstra...sys.argv[1:]) " /Library/Python/2.7/...ols-0.6c11-py2.7.egg: Traceback (most recent call last): File "<string>", line 279, in <module> File "<string>", line 207, in main File "/Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/__init__.py", line 2, in <module> File "/Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg/setuptools/extension.py", line 1, in <module> File "/Users/ololoev/.virtualenvs/kit/lib/python2.7/distutils/__init__.py", line 16, in <module> exec(open(os.path.join(distutils_path, '__init__.py')).read()) IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py' ---------------------------------------- ...Installing setuptools...done. Traceback (most recent call last): File "/Library/Python/2.7/site-packages/virtualenv.py", line 2429, in <module> main() File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main never_download=options.never_download) File "/Library/Python/2.7/site-packages/virtualenv.py", line 1052, in create_environment search_dirs=search_dirs, never_download=never_download) File "/Library/Python/2.7/site-packages/virtualenv.py", line 598, in install_setuptools search_dirs=search_dirs, never_download=never_download) File "/Library/Python/2.7/site-packages/virtualenv.py", line 570, in _install_req cwd=cwd) File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /Users/ololoev/.virtualenvs/kit/bin/python -c "#!python \"\"\"Bootstra...sys.argv[1:]) " /Library/Python/2.7/...ols-0.6c11-py2.7.egg failed with error code 1
# -*- coding: utf-8-*- from twisted.internet.protocol import Factory, Protocol class MyProtocol(Protocol): def connectionMade(self): print "соединение установлено" def connectionLost(self, reason): print "Соединение разорвано ", reason def dataReceived(self, data): print "получены данные ", data def dataSend(self, data): self.transport.write(data) class MyFactory(Factory): protocol = MyProtocol if __name__ == '__main__': from twisted.internet import reactor reactor.listenTCP(9000, MyFactory()) reactor.run()
Traceback (most recent call last): File "<stdin>", line 1, in <module> _pylibmc.MemcachedError: error 37 from memcached_set: SUCCESS
query_string = "select convert(decimal(2,0),10.32)"
cur.execute(query_string.encode('utf-8')) data_procedure = cur.fetchall()
Traceback (most recent call last): File "<console>", line 1, in <module> Error: ('HY003', '[HY003] [FreeTDS][SQL Server]Program type out of range (0) (SQLGetData)')
# -*- coding: utf-8 -*- import xlwt wbk = xlwt.Workbook(encoding='utf8') sheet = wbk.add_sheet('страница1') sheet.write(0,1,'10') sheet = wbk.add_sheet('страница2') sheet.write(0,1,xlwt.Formula('страница1!B1')) wbk.save('test.xls')
/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python /Users/ava/PycharmProjects/sacore/test.py Traceback (most recent call last): File "/Users/ava/PycharmProjects/sacore/test.py", line 8, in <module> sheet.write(0,1,xlwt.Formula('страница1!B1')) File "/Library/Python/2.6/site-packages/xlwt/ExcelFormula.py", line 22, in __init__ raise ExcelFormulaParser.FormulaParseException, "can't parse formula " + s xlwt.ExcelFormulaParser.FormulaParseException: can't parse formula страница1!B1 Process finished with exit code 1
class infoLay(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, None) self.ean_edit = QtGui.QLineEdit() self.ean_edit.setDisabled(1) self.ean_edit.setMinimumWidth(70) self.ean_edit.setMaximumWidth(100) #Бла Бла бла еще много строчек кода
class infoLayMeta(type): def __init__(cls, name, bases, dict): super(infoLayMeta, cls).__init__(name, bases, dict) cls.instance = None self.ean_edit = QtGui.QLineEdit() self.ean_edit.setDisabled(1) self.ean_edit.setMinimumWidth(70) self.ean_edit.setMaximumWidth(100) #Бла бла бла def __call__(self,*args,**kw): if self.instance is None: self.instance = super(SingletonMeta, self).__call__(*args, **kw) return self.instance class infoLay(object): __metaclass__ = infoLayMeta