I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed.
I followed the instructions on http://hg-git.github.com/ to install the extension. The initial easy_install failed because it was unable to compile dulwich without Visu...
Template:
<form method="POST" action="/customer/delete/">
<div style="float: right;
margin: 0px; padding: 05px; ">
Name:<select name="customer">
{% for customer in customer %}
<option value="{{ customer.name|escape }}" ></option><br />
{% endfor %}
</select>
<input type=submit value="delete">
</div>
</form>
Views:
d...
I am not getting usage scenarios or design goals of python __init__.py in my projects.
Assume that I have 'model' directory (refers as a package) which I have kept the following files.
1. __init__.py
2. meta.py
3. solrmodel.py
4. mongomodel.py
5. samodel.py
I found two ways of using __init__.py.
I have common definition which n...
I am working on a project where we have a large number of objects being serialized and stored to disk using pickle/cPickle.
As the life of the project progresses (after release to customers in the field) it is likely that future features/fixes will require us to change the signature of some of our persisted objects. This could be the a...
I'm trying to solve a Poisson equation on a rectangular domain which ends up being a linear problem like
Ax=b
but since I know the boundary conditions, there are nodes where I have the solution values. I guess my question is...
How can I solve the sparse system Ax=b if I know what some of the coordinates of x are and the undetermin...
I generally make my desktop interfaces with Qt, but some recent TK screenshots convince me Tk isn't just ugly motif any more.
Additionally Tkinter comes bundled with Python, which makes distribution easier.
So is it worth learning or should I stick with Qt?
...
In Python, I would like to get the first item from a list matching a condition. For example, the following function is adequate:
def first(the_iterable, condition = lambda x: True):
for i in the_iterable:
if condition(i):
return i
This function could be used something like this:
>>> first(range(10))
0
>>> firs...
TemplateSyntaxError at /tribes/
Caught an exception while rendering: (1146, "Table 'basic_project.topics_topic' doesn't exist")
why ??
thanks
...
The setup is a Django based website on an Ubuntu server system with lots of useful information in /usr/share/i18n/locales.
The question: Can I access this pool of wisdom without using Python's locale.setlocale() afore?
The reason: The docs say, that it is
very expensive to call setlocale(), and
affects the whole application.
But in...
Hi. I like to switch x axis with y axis after plotting a graph with matplotlib? Any easy way for it? Thanks in advance.
...
I have a list containing data as such:
[1, 2, 3, 4, 7, 8, 10, 11, 12, 13, 14]
I'd like to print out the ranges of consecutive integers:
1-4, 7-8, 10-14
Is there a built-in/fast/efficient way of doing this?
...
Can anyone point me towards a ready made RSS screen scraper, preferably in Python in order to get full text RSS feeds?
...
I'm having a hard time finding the regex for the start and end of a file in python.
How would I accomplish this ?
...
HI
I want to capture the UDP packets by joining to the Multicast group. after the receving the packet i want to check for the TTL value from that UDP packet. How can i achieve this by using python ?
The Sammple code as mentioned below:
here
rec_port is any port which i had used to bind; eg: 9180
rec_hostname is any multicast group wh...
How to print the test field in the following query in django
res=Resources.objects.filter(test=request.profile)
logging.debug(test) # won't work
I wanted to check what this value is compared with..
...
Hello there,
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin...
I'm using httplib2 to make a request from my server to another web service. We want to use mutual certificate authentication. I see how to use a certificate for the outgoing connection (h.set_certificate), but how do I check the certificate used by the answering server?
This ticket seems to indicate that httplib2 doesn't do it itself,...
Hi,
Im trying to teach python to a Law student (happens to be my fiancee).She has been insisting on me teaching her about it. One problem: She doesn't know anything about programming.
I was thinking on starting with dive into python, but i'm worried most not about the python part, but the "she does not know anything about programming"...
Hi to all,
I have the following function that walks a nested tree and prints the result
def walk_tree(tree):
def read_node(node):
print node
for n in node['subnodes']:
read_node(n)
read_node(tree)
If I want to return a txt with the data collected from walking the tree, thought that the following...
Hello All,
I would like to use regular expression to extract only @patrick @michelle from the following sentence:
@patrick @michelle we having diner @home tonight do you want to join?
Note: @home should not be include in the result because, it is not at beginning of the sentence nor is followed by another @name.
Any solution, tip,...