Installing second python on Debian

So I have Debian machine for my Django production server. I need to install second python (2.7.1) to use with virtualenv. But it always write I don't have some modules, then I have to search manually, apt-install them and rebuild. Is there either a way to resolve the dependencies for building, or pre-compiled .deb with python 2.7.1 for Debian Squeeze? Sorry if this is much of a noobie que

在Debian上安装第二个python

所以我有我的Django生产服务器的Debian机器。 我需要安装第二个python(2.7.1)以与virtualenv一起使用。 但它总是写我没有一些模块,然后我必须手动搜索,apt-install他们并重建。 有没有一种方法来解决构建的依赖关系,或者使用Python 2.7.1 for Debian Squeeze预编译.deb? 对不起,如果这是一个noobie问题,我诚实地搜索了一下。 获取Python 2.7.1源并手动编译它: configure --prefix=/path/to/python-2.7 make; make i

OpenCV Python and Histogram of Oriented Gradient

Is there any useful documentation for using the HOGDescriptor functionality in Python OpenCV? I have read the C++ documentation, but the Python version functions differently and I cannot figure it out just by tinkering. Most specifically, I am seeking an OpenCV command in Python that takes an image and a pixel location as input (and possibly also some parameters about the size of a detection w

OpenCV Python和面向梯度的直方图

有什么有用的文档可以在Python OpenCV中使用HOGDescriptor功能吗? 我已经阅读了C ++文档,但是Python版本的功能不同,我不能仅仅通过修改就能搞清楚。 最特别的是,我正在寻找一种Python中的OpenCV命令,它将图像和像素位置作为输入(并且可能还有一些关于检测窗口大小的参数),然后返回一个包含HOG特征向量的Python数组(即列表或NumPy数组等,其中列表的第j个元素是来自定向梯度直方图的第j个直方图分量)。 我的目标是

Perspective transform with whole image

So I have four points in an array A , denoting the corners of a rectangular object (but not a rectangle when projected onto the image plane). I know the size of the rectangle, so I can calculate the perspective transform with cv2.getPerspectiveTransform(four_corners, np.array([[0, 0], [0, height], [width, height], [width, 0], dtype=np.float32)) Then I can transform the image with cv2.warpPersp

透视转换与整个图像

所以我在数组A有四个点,表示一个矩形对象的角(但投影到图像平面上时不是矩形)。 我知道矩形的大小,所以我可以用它来计算透视变换 cv2.getPerspectiveTransform(four_corners, np.array([[0, 0], [0, height], [width, height], [width, 0], dtype=np.float32)) 然后我可以用cv2.warpPerspective转换图像。 问题(可以通过计算透视变换目标图像的宽高比来证明另一个人的问题)是扭曲的结果被裁剪。 只有四角内的区域处

method's arguments not being passed to decorator

hey I have a method defined as follows: from x.y import util class my_Class(some_object): @util.myDecorator def foo(self, log_file): ''' Test that search entered into the search bar is the search being executed in the job. ''' self.some_page.open() textarea = self.some_page.searchbar searchbar.run_search(log_file.search_string) self.browser.capture_screen

方法的参数不被传递给装饰器

嘿我有一个方法定义如下: from x.y import util class my_Class(some_object): @util.myDecorator def foo(self, log_file): ''' Test that search entered into the search bar is the search being executed in the job. ''' self.some_page.open() textarea = self.some_page.searchbar searchbar.run_search(log_file.search_string) self.browser.capture_screenshot() self

Using Django

I'm trying to implement openid login with Django and having some trouble. The library I'm trying to use now is Django-openid-auth. I haven't found any django+openid libraries that have much documentation. How can I actually go about using this as a login and store the information I need for my app based on the users that come in from openid? How does this store the information sha

使用Django

我试图用Django实现openid登录并遇到一些麻烦。 我现在试图使用的库是Django-openid-auth。 我还没有找到任何有很多文档的django + openid库。 我怎么能真正使用这个作为登录和基于从openid进来的用户存储我的应用程序需要的信息? 这是如何存储从openid提供者共享的信息的,这个库是否已经存储了它? OpenID身份验证过程最常用的步骤如下: 用户将他们的OpenID输入到consumer'ssite的字段中,然后点击登录按钮。

What's the best solution for OpenID with Django?

Please note : this is an ancient question with ancient answers. Most of the linked apps are now unmaintained. These days, most people seem to use django-allauth or python-social-auth. I'll leave the original question intact below for posterity's sake. There are at least half a dozen Django apps that provide OpenID authentication for Django: django-openid django-openid-auth anot

Django使用OpenID的最佳解决方案是什么?

请注意 :这是一个带有古代答案的古老问题。 大多数关联的应用程序现在无人维护。 现在,大多数人似乎都使用django-allauth或python-social-auth。 为了后代的缘故,我会在下面保留原始问题。 至少有半打Django应用程序为Django提供OpenID身份验证: Django的OpenID的 Django的OpenID的身份验证 另一个django-openid-auth,似乎已经死了 Django的authopenid django-socialauth(也提供Twitter和Facebook帐户的身

How to define LTI systems with Time delay in Scipy?

The transfer function of an LTI system with time delay has a numerator term exp(-Td * s) where Td is the time delay. In Matlab, one could create such an LTI system in many ways (eg using the "s" operator and setting the exponential term directly or by setting the inputdelay outputdelay properties of tf objects.) However, I cannot find any way to do this in Scipy Signal LTI objects. I

如何在Scipy中定义带延时的LTI系统?

具有时间延迟的LTI系统的传递函数具有分子项exp(-Td * s),其中Td是时间延迟。 在Matlab中,人们可以创建在许多方面这样的LTI系统(例如,使用“S”运营商和直接设置的指数项或通过设置inputdelay outputdelay的性质tf的对象。)但是,我找不到任何方式做到这一点Scipy Signal LTI对象。 我也检查了Python控制系统库,但仍然找不到方法。 我不想使用时间延迟的Pade逼近,并且想要为LTI系统设置精确的时间延迟。 有谁知道如

UnicodeDecodeError with PIP?

I am attempting to distribute my open-source project, Melopy, but package management has been giving me problems since I started. Today, I registered for PyPI, but upon running python setup.py sdist upload I am faced with the following error. running sdist running check reading manifest template 'MANIFEST.in' not writing to manually maintained manifest file 'MANIFEST' making hard links in Melop

带PIP的UnicodeDecodeError?

我试图分发我的开源项目Melopy,但自从我开始以来,软件包管理一直给我带来问题。 今天,我注册了PyPI,但是在运行python setup.py sdist upload我遇到了以下错误。 running sdist running check reading manifest template 'MANIFEST.in' not writing to manually maintained manifest file 'MANIFEST' making hard links in Melopy-0.1.0... Creating tar archive Traceback (most recent call last): File "setup.py", lin

How to forward geocode in Python without Internet connection from scripts?

I have addresses I want to convert into latitudes and longitudes. I do not have admin rights on my computer, so Python scripts cannot connect to the geocoding APIs (ie Google, Nominatim, etc.). I have tried the geocoding packages available on PyPi. Do you all know of any alternative to connecting directly to the API? Is there anyway to do offline geocoding? I have seen packages for offline

如何在没有Internet连接的情况下使用Python转发地理编码?

我有我想要转换成纬度和经度的地址。 我的电脑上没有管理员权限,因此Python脚本无法连接到地理编码API(即Google,Nominatim等)。 我尝试了PyPi上的地理编码包。 你们是否都知道可以直接连接API? 无论如何去做离线地理编码? 我已经看到用于离线反向地理编码的软件包,但不能用于前向地理编码。 从逻辑上讲,我能想到的唯一选择是全面下载数据并进行本地比较。 但我不确定这种可行性。 任何想法都很感激! geopy

Chained comparisons in SQLAlchemy

Python supports chained comparisons: 1 < 2 < 3 translates to (1 < 2) and (2 < 3) . I am trying to make an SQL query using SQLAlchemy which looks like this: results = session.query(Couple).filter(10 < Couple.NumOfResults < 20).all() The results I got were not as expected. I've turned the engine's echo=True keyword, and indeed - the generated SQL query only included o

在SQLAlchemy中链接比较

Python支持链式比较: 1 < 2 < 3转换为(1 < 2) and (2 < 3) 。 我正在尝试使用SQLAlchemy进行SQL查询,如下所示: results = session.query(Couple).filter(10 < Couple.NumOfResults < 20).all() 我得到的结果并不如预期。 我已经将引擎的echo=True关键字转换成了,实际上 - 生成的SQL查询只包含两个比较中的一个。 我找不到任何明确表示这是禁止的文档。 我认为如果Python中支持这种类型的表达式,