Hi,
I'm using the Windmill test system and have it running using test_windmill for Django which works fine for the Python tests. I'd like this to run a suite of Javascript tests also whilst the Django test server is running. I've used the run_js_tests call from the Windmill shell which works fine but I can't find a way to have this run ...
I notice this thread: Fastish Python/Jython IPC, and I have a similar problem, but in different language.
I have a Java front-end and a C++ back-end, which I am thinking about rewrite it in Python in some near future. What will be the best IPC? I prefer socket to HTTP, as I am trying to avoid the HTTP overhead. And XML-RPC is an example...
Hi,
I am writing a pycurl script, which worked right on linux, but on mac os x I get the error:
Traceback (most recent call last):
File "curl.py", line 47, in <module>
c.perform()
pycurl.error: (7, "couldn't connect to host")
any help?
Thanks
...
I am calling a form as follows, then passing it to a template:
f = UserProfileConfig(request)
I need to be able to access the request.session within the form... so first I tried this:
class UserProfileConfig(forms.Form):
def __init__(self,request,*args,**kwargs):
super (UserProfileConfig,self).__init__(*args,**kwargs)
...
Here is absolutely minimal application so you could try to reproduce it on your machine.
Having two files for example in /home/aln/tmp/tw_test:
server.tac
MyLib.py
MyLib.py
class Solver(object):
def solve(self):
""" do extremely complex stuff here """
print "Hello from solve"
server.tac
#!/usr/bin/python
impor...
Hi,
I'm creating a RESTful API which needs to access the database. I'm using Restish, Oracle, and SQLAlchemy. However, I'll try to frame my question as generically as possible, without taking Restish or other web APIs into account.
I would like to be able to set a timeout for a connection executing a query. This is to ensure that lo...
I need to get the final URL after redirection in python.
What's a good way to do that?
...
Is there some way (using the standard Django.test.TestCase framework) to perform a global initialization of certain variables, so that it only happens once.
Putting things setUp() makes it so that the variables are initialized before each test, which kills performance when the setup involves expensive operations. I'd like to run a setup...
Hi,
I need to generate the strings STA and STB.
STA and STB are strings of length 10, and each one can contain only the characters A,T,G or C.
I have to generate all possible combinations of STA, and depending on STA, I generate STB.
The ways is that the character A is always associated with T and viceversa and G with C and viceversa...
Hi everybody!
What I'm trying to do is to manage several forms in one page, I know there are formsets, and I know how the form management works, but I got some problems with the idea I have in mind.
Just to help you to imagine what my problem is I'm going to use the django example models:
from django.db import models
class Poll(model...
The Psyco docs say:
Just for reference, Psyco does not
work on any 64-bit systems at all.
This fact is worth being noted again,
now that the latest Mac OS/X 10.6
"Snow Leopart" comes with a default
Python that is 64-bit on 64-bit
machines. The only way to use Psyco on
OS/X 10.6 is by recompiling a custom
Python in 32-...
I'm using sqlalchemy 6.0. The SQL Server T-SQL dialect seems to want to make any integer that's part of my primary key into an identity. That may be ok if the integer field were the primary key, but mine is a composite and this isn't going to work for me. Is there a way to suppress this behavior?
Here's a demonstration of the problem:
...
I'm trying to hash a password to dump into a .rdp file. I found a site that (more or less) shows how to do that here but it doesn't work in 3.1.
In 2.5.4 I get this:
>>> import win32crypt
>>> import binascii
>>> pwdHash = win32crypt.CryptProtectData(u"password",u'psw',None,None,None,0)
>>> print str(binascii.hexlify(pwdHash)).upper()
0...
How would one expose "static" variables like this
class MyClass:
X = 1
Y = 2
via the C API? The only variable on the PyTypeObject that looks like it would work is tp_members, but I see no flag in the PyMemberDef to indicate that the member should be per-class, not per-instance.
For a bit more clarification, since it may chang...
Is there any way to write binary output to sys.stdout in Python 2.x? In Python 3.x, you can just use sys.stdout.buffer (or detach stdout, etc...), but I haven't been able to find any solutions for Python 2.5/2.6.
EDIT, Solution:
From ChristopheD's link, below:
import sys
if sys.platform == "win32":
import os, msvcrt
msvcrt.se...
Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array?
I am looking for something similar to Excel's percentile function.
I looked in NumPy's statistics reference, and couldn't find this. All I could find is the median (50th percentile), but not something more specific.
...
Hi if I do the following I can convert from a time_struct object to a datetime object:
mydate = datetime.datetime(*time.localtime()[:6])
How does this code work? What do the * and the [:6] mean?
...
Hello,
I'm looking for a way to list all fonts installed on a linux/Debian system, and then generate images of some strings using these fonts. I'm looking for your advice as I kind of see how to do each part, but not to do both:
To list all fonts on a UNIX system, xlsfonts can do the trick:
import os
list_of_fonts=os.popen("xslfonts"...
Hello,
I want to color the background (SetBackgroundColour) of a wx.Panel with a blue to black degradê.
How can I make it?
...
I've been trying to work out the 'best practices' way to manage file uploads with Turbogears 2 and have thus far not really found any examples. I've figured out a way to actually upload the file, but I'm not sure how reliable it us.
Also, what would be a good way to get the uploaded files name?
file = request.POST['file']
perma...