I'm considering to use XML-RPC.NET to communicate with a Linux XML-RPC server written in Python. I have tried a sample application (MathApp) from Cook Computing's XML-RPC.NET but it took 30 seconds for the app to add two numbers within the same LAN with server.
I have also tried to run a simple client written in Python on Windows 7 to ...
I'm writing quite a few unit tests and using nosetests to run them. Nose certainly makes it nice and easy to run tests, but the output can be pretty cluttered at the best of times, and a downright mess at others, depending on warnings and errors.
I was wondering if there are any visual tools that wrap nose so that the feedback cleaner....
Hello everyone,
I have an odd problem. I know that in Python, kwargs follow args, so I checked for that and it's not the problem. What is the problem is this:
Fine:
def __init__(self, sample_rate, label=u"", data=[] ):
TypeError: __init__() got multiple values for keyword argument 'data':
def __init__(self, sample_rate, data=[], l...
I have a query that orders a table according to a particular field. The table is related to one competition, so knowing the position is important.
As the table can grow to have a lot of rows, I have paginate it (25 rows per page) using generic views, but the problem I've got is to present the numbered position on the table. This informa...
Has anyone any suggestions on how to use internationalization in app engine / webapp / python. I have seen some posts re - django - translation support but i cant seem to find enough info on how to make it work.
What i need is a solution where
browser can detect language
user can override and set
strings in templates and from code can...
Hi,
I hope this is the right place to ask this question:
I am trying to compile gVim with python 3 support using cygwin under windows:
I changed the Make_cyg.mak files Python section to the following:
##############################
# DYNAMIC_PYTHON=yes works.
# DYNAMIC_PYTHON=no does not (unresolved externals on link).
##############...
I'm trying to do something similar to this, in Django. This is part of the page of Anna:
Pos NickName Points
--- --------- ------
1 The best 1000
...
35 Roger 550
36 Anna 545
37 Paul 540
It's a chart showing the scoring system, and it intends to show the first position, as well as the relat...
While developing a Django app deployed on Apache mod_wsgi I found that in case of multithreading (Python threads; mod_wsgi processes=1 threads=8) Python won't use all available processors. With the multiprocessing approach (mod_wsgi processes=8 threads=1) all is fine and I can load my machine at full.
So the question: is this Python beh...
I'd like to tell urllib2.urlopen (or a custom opener) to use 127.0.0.1 (or ::1) to resolve addresses. I wouldn't change my /etc/resolv.conf, however.
One possible solution is to use a tool like dnspython to query addresses and httplib to build a custom url opener. I'd prefer telling urlopen to use a custom nameserver though. Any suggest...
We have a script which pulls some XML from a remote server. If this script is running on any server other than production, it works.
Upload it to production however, and it fails. It is using cURL for the request but it doesn't matter how we do it - fopen, file_get_contents, sockets - it just times out. This also happens if I use a Pyth...
I would like to make a queryset on a generic view in this way:
category_info = {
'queryset' : ModelObject.objects.filter(category=category_id)
}
where the category_id will be stated on the URL
(r'^category/(?P<category_id>\d+)$', 'object_list', category_info )
But I don't know how to take the data from the URL and pass it ...
What would be the most pythonesque way to find the first index in a list that is greater than x?
For example, with
list = [0.5, 0.3, 0.9, 0.8]
The function
f(list, 0.7)
would return
2.
...
I have a Dynamic Form in forms. How can I pass a argument from my view when I instantiate my form.
something like
form = DynamicForm("some string argument")
This is the form I have:
class DynamicForm(Form):
def __init__(self, *args, **kwargs):
super(DynamicForm, self).__init__(*args, **kwargs)
for item in range(5):
...
while 1:
text_file = open("write_it.txt", "w")
word = input("Please add to a text file: ")
What else do I need to add to make my code run properly?
...
Hi,
I'm trying to use figure out how to sub query a query that uses a filter. From what I've figured out so far while using .filter() it changes the original query, that leads to a second .filter() would also have to match the first filter.
I would like to make something like this:
modules = data.Modules.all().filter('page = ', page.k...
I'm trying to debug a Python Django app.
I've got additional fields being added to a model.
I've tracked this down to one method:
django.db.models.options.add_field()
The only place this method is called is:
django.db.models.fields.init.contribute_to_class()
def contribute_to_class(self, cls, name):
self.set_attributes_from_name...
I read this guide about serving static media with Django during development.
I noticed that MEDIA_URL and MEDIA_ROOT were not used in this. Why? What's the difference?
I tried doing it with MEDIA_URL and MEDIA_ROOT, and got weird results.
...
I have device connected through serial port to PC. Using c-kermit I can send commands to device and read output. I can also send files using kermit protocol.
In python we have pretty nice library - pySerial. I can use it to send/receive data from device. But is there some nice solution to send files using kermit protocol?
...
I have decorator @login_testuser applied against method test_1:
class TestCase(object):
@login_testuser
def test_1(self):
print "test_1()"
Is there a way I can apply @login_testuser on every method of the class prefixed with "test_"?
In other words, the decorator would apply to test_1, test_2 methods below, but not o...
Hello, I want to show my calculated output to Gui window in python.I am trying with Tkinter.But having problem to get output on Tkinter level widget.The thing is that, I am putting input data as address information in text field of Tkinter window and want latitude , longitude of that inputed address to the text label. Can anyone please h...