I'm getting some integration tests running against the database, and I'd like to have a structure that looks something like this:
class OracleMixin(object):
oracle = True
# ... set up the oracle connection
class SqlServerMixin(object):
sql_server = True
# ... set up the sql server connection
class SomeTests(object):
...
I was testing a web service in PHP and Python. The address of the web service was, let's say, http://my.domain.com/my/webservice. When I tested the web service in PHP using that URL everything worked fine. But, when I used the same location but in Python using SOAPpy I got an error.
Below is the code I used to communicate with the web s...
Note: There is a very similar question here. Bear with me, however; my question is not "Why does the error happen," but "Why was Python implemented as to throw an error in this case."
I just stumbled over this:
a = 5
def x()
print a
a = 6
x()
throws an UnboundLocalException. Now, I do know why that happens (later in this scop...
What are the rules surrounding Python threads and how Unix signals are handled?
Is KeyboardInterrupt, which is triggered by SIGINT but handled internally by the Python runtime, handled differently?
...
I'm trying to translate an Excel spreadsheet to CSV using the Python xlrd and csv modules, but am getting hung up on encoding issues. Xlrd produces output from Excel in Unicode, and the CSV module requires UTF-8.
I imaging that this has nothing to do with the xlrd module: everything works fine outputing to stdout or other outputs that d...
As the title suggest, I was wondering if there is a Python module that can access an Advantage Database Server (Sybase) files such as ADT and DBF.
I have searched the web and couldn't find what I'm looking for this is why I wanted to ask it here.
...
Something which doesn't rely on native libraries would be even more better.
...
I haven't found anything in their documentation or on the web that says yes or no. Using the Python library.
...
While trying to figure out the best method to ping (ICMP) something from python, I came across these questions:
How can I perform a ping or traceroute in python, accessing the output as it is produced?
ping a site in python
How can I perform a ping or traceroute using native python?
The answers generally boil down to "use this third ...
My Django site recently started throwing errors from my caching code and I can't figure out why...
I call:
from django.core.cache import cache
cache.set('blogentry', some_value)
And the error thrown by Django is:
TransactionManagementError: This code isn't under transaction management
But looking at the PostgreSQL database logs, i...
Suppose that I have class C.
I can write o = C() to create an instance of C and assign it to o.
However, what if I want to assign the class itself into a variable and then instantiate it?
For example, suppose that I have two classes, such as C1 and C2, and I want to do something like:
if (something):
classToUse = C1
else:
class...
When hovering over a data point in Chaco, I would like a small text box to appear, with the text I desire. Also, when I click on a data point (or close enough), I would like my program to take a certain action. I have seen relevant parts of the Chaco documentation, but implementing them has proved difficult. Any help would be appreciated...
I have no experience compiling code other than using Visual Studio's Build command. I am hoping we can create a step by step guide for compiling mod_python on windows. Please be as descriptive as possible.
This is what I've done so far:
Download and install python 2.6.2
Download and install apache 2.2.11
Download the most recent sourc...
What's the best approach to writing multi-threaded applications in Python, I'm aware of the basic concurrency mechanisms provided by the language and also of Stackless Python. What would you recommend and why?
...
I am trying to perform a migration from cvs to svn on my our new XServe server which is running Mac OSx server edition. There is a known conflict between the dbm libraries that come pre installed with mac osx and the cvs2svn. The error it gives is this "ERROR: cvs2svn uses the anydbm package, which depends on lower level dbm libraries....
I've just started learning Emacs, and decided to start writing Python in it. I tried using C-c C-c to execute the current buffer, but I get the message Searching for program: no such file or directory, python.
I've looked on google, but I'm none the wiser as to how to sort this out (bear in mind I know next to nothing about Emacs!)
...
The question is not the same as What’s the best way to generate a UML diagram from Python source code?, but the other way around.
Topcoder UML tool automatically generates code in only Java or C#. Since I need to create a very depended data structure at a point, I am hesitant to turn to Java. I want to use Python. So:
Is there an UML-...
In other Python IDEs (PythonWin and Idle) it's possible to hit a key and have your current source file window reloaded into the console. I find this useful when experimenting with a piece of code; you can call functions from the console interactively and inspect data structures there.
Is there a way to do this with Eclipse/Pydev?
So f...
This is a query that totals up every players game results from a game and displays the players who match the conditions.
select *,
(kills / deaths) as killdeathratio,
(totgames - wins) as losses
from (select gp.name as name,
gp.gameid as gameid,
...
I'm trying to set up Mercurial repositories to be hosted by IIS under Windows Server 2003. Following this post I installed Python 2.5.4.4 and Mercurial 1.3, set up virtual dir, extracted library.zip and created hgwebdir.config.
However, when I trying to open the http://hostname/hg/hgwebdir.cgi I got an error “The specified CGI applicati...