Hi everybody
I have read a bunch of threads on setuptools here.
A lot of people seem not to like it very much.
But I need to install MySQL-python-1.2.3. and when I do that I get this error:
MySQL-python-1.2.3 X$ python setup.py cleanTraceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools ...
I've some hard time understanding Integration testing in general, I want to do some integration testing in python expecially for network programming in twisted (but I want to know something more in general).
There are any good resource I must read, and tools (python tools if possible), practices that introduces me in integration testing...
i have the following:
ora_wet = oracle_connection()
cursor = ora_wet.cursor()
sqlQuery = u"SELECT * FROM web_cities WHERE cty_name = 'София'"
cursor.execute(sqlQuery)
sqlResult = cursor.fetchone()
When I do this I get a TypeError: expecting None or a string on line 18 which is the cursor.execute(sqlQuery)
If I make the query non-uni...
Hi All,
i have dozen of test cases in different folders. In the root directory there is a test runner.
unittest\
package1\
test1.py
test2.py
package2\
test3.py
test4.py
testrunner.py
Currently I added the four test cases manually into a test suite
import unittest
from package1.test1 import Test1
from package1....
If I have a list of numpy arrays, then using remove method returns a value error.
For example:
import numpy as np
list = [np.array([1,1,1]),np.array([2,2,2]),np.array([3,3,3])]
list.remove(np.array([2,2,2]))
Would give me
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
...
How can i install this?
Any suggestion would be great.
I have read these tutorials:
http://www.tutorialspoint.com/python/python_database_access.htm
http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/
http://openlandscape.wordpress.com/2007/11/16/setting-up-mysql-for-python-mysqldb-on-mac-os-x/
http://www.b...
Is there a way to make unittest.TextTestRunner completely quiet, meaning that it never prints to output on its own? Even at verbosity=0 it prints results when done.
The thing is that i want to process the TestResult object returned by the runner before anything is printed.
...
I have what I call a catalogue, a dictonary like this:
fields = ("property1", "property2")
catalogue = { 0.3: {
100: [ {"property1": 0.3, "property2": 100, "value": 1000},
{"property1": 0.3, "property2": 100, "value": 2000},
{"property1": 0.3, "property2": 100, "val...
I'm working on a python project in 2.6 that also has future support for python 3 being worked in. Specifically I'm working on a digest-md5 algorithm.
In python 2.6 without running this import:
from __future__ import unicode_literals
I am able to write a piece of code such as this:
a1 = hashlib.md5("%s:%s:%s" % (self.username, s...
In Python, you can have key,value pairs in a dictionary where you can loop through them, as shown below:
for k,v in d.iteritems():
print k,v
Is there a way to do this with Java HashMaps?
...
Hey,
I am creating a keylogger to monitor my PC and I want to have a key combination that shuts the keylogger off or turns on the user interface, not sure yet. But the problem is that I can't figure out how to check if two or three buttons are being pressed at the same time ? How do I do that ?
Here's my source so far :
http://paste.poco...
Hi, I created a rest api using django and piston and I need to create a script that uploads a file to that api.
currently I'm using this code:
import urllib
import urllib2
user = 'patrick'
password = 'my_password'
url = 'http://localhost:8000/api/odl/'
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
password_manager.add_...
Hello,
I'm new to QT. I'm using PyQT for GUI development in my project. I want to achieve this layout in my application. This application searches images from an image database. Google image search layout is ideal for my purpose.
I'm following the book "Rapid GUI Programming with Python and Qt" and I'm familiar with layouts. I guess...
Hi folks,
I need to track/log activity on the Django admin.
I know there are messages stored by admin somewhere, but I don't know how to access them in order to use them as a simple log.
I'm trying to track the following:
User performing the action
Action committed
Datetime of action
Thanks guys.
...
Is there a way to display the product name and version of a msi file from the command line? Or better yet, can this be done via python?
...
I have an app called pta.apps.users which is loaded in the Loaded apps setting in my settings.py.
The app works fine, I now want to test it and have placed json files in the fixtures directory inside my users app.
I have a test which runs fine but the fixtures wont load.
from django.test import TestCase
from django.test.client import...
Hey,
Do you know of a good free/open source test automation infrastructure?
I'm looking for infrastructure (python is preferred) which has features like:
connecting to a remote computer.
running python scripts on a remote computer.
Identification of UI components
watch dog.
test report summery generation
anything else useful (:
Thx,...
How do pythonistas print a number as words, like the equivalent of the Common Lisp code:
[3]> (format t "~r" 1e25)
nine septillion, nine hundred and ninety-nine sextillion, nine hundred and ninety-nine quintillion, seven hundred and seventy-eight quadrillion, one hundred and ninety-six trillion, three hundred and eight billion, three hu...
Greetings
Having an ImageField object in my Foo model as such:
class Foo(models.Model):
name = models.CharField(max_length=50)
photo = models.ImageField(upload_to='foobar', blank=True, null=True)
I want Foo to disable to delete the uploaded photo once a Foo object is deleted and a specific . How can I do this?
Ie:
If self.na...
Hi. This question concerns running python files in terminal that are not stored in the home directory. I think I have solved the first bit of this puzzle by modifying my path so that it includes the directory where my python programs are stored.
So where as initially
echo $PATH would yield the following: /usr/bin:/bin:/usr/sbin:/sbin:...