I want to automatically generate booking confirmation PDF files in Python. Most of the content will be static (i.e. logos, booking terms, phone numbers), with a few dynamic bits (dates, costs, etc).
From the user side, the simplest way to do this would be to start with a PDF file with the static content, and then using python to just a...
A while ago I had to upgrade some servers from Python 2.4 to Python 2.5. I found that .pyc files created under Python 2.4 would crash when Python 2.5 tried to run them.
Will this happen again when I upgrade from 2.5 to 2.6?
EDIT: Here is a bit more detail
I have a fileserver that contains the python code. This is accessed by both Ubun...
Hi all,
I am very new to Python and parsing data.
I can pull an external JSON feed into Python and iterate over the results.
for r in results:
print r['key_name']
As I walk through the results returned, I am getting an error when a key does not have a value (a value may not always exist for a record). If I print the results,...
I have edited about 100 html files locally, and now I want to push them to my live server, which I can only access via ftp.
The HTML files are in many different directories, but hte directory structure on the remote machine is the same as on the local machine.
How can I recursively descend from my top-level directory ftp-ing all of the...
Hello!
I'm developing a Genetic Algorithm in python were chromosomes are composed of strings and integers. To apply the genetic operations, I want to convert these groups of integers and strings into bit strings.
For example, if one chromosome is:
["Hello", 4, "anotherString"]
I'd like it to become something like:
010010010010100101...
So, I'm writing a python web application using the twisted web2 framework. There's a library that I need to use (SQLAlchemy, to be specific) that doesn't have asynchronous code. Would it be bad to spawn a thread to handle the request, fetch any data from the DB, and then return a response? I'm afraid that if there was a flood of requests...
This is a difficult problem to describe so please let me know if anything is unclear.
I am trying to solve a possible deadlock situation in my C++ app and I am having trouble visualizing an appropriate solution. The restrictions placed on me by the two libraries I am trying to connect make my problem very complex and troublesome but it...
I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph.
For example:
Covert this edge list:
[A...
thanks
the next is mysite1\django_openid\registration.py:
from django.http import HttpResponseRedirect
from django.core.mail import send_mail
from django.conf import settings
from django_openid.auth import AuthConsumer
from django_openid.utils import OpenID, int_to_hex, hex_to_int
from django_openid import signed
from django_openid ...
I have a randomly generated string from 6 letters in this form, example:
A' B F2 E' B2 A2 C' D2 C D' E2 F
Some letters have " ' " added to them some have number "2". What i want is to add letter "x" to every letter that is on its own.
So it would look like this:
A' Bx F2 E' B2 A2 C' D2 Cx D' E2 Fx
The trick is that it would add t...
Hi guys,
I have been struggling with this for over two days and I could use your help. Here's the problem:
Whenever a request is made to the Facebook REST server, we have to send an additional parameter called "sig". This sig is generated using the following algorithm:
<?php
$secret = 'Secret Key'; // where 'Secret Key' is your appli...
I need to write a code that runs similar to normal calculators in such a way that it displays the first number I type in, when i press the operand, the entry widget still displays the first number, but when i press the numbers for my second number, the first one gets replaced. I'm not to the point in writing the whole code yet, but I'm s...
I'm working on a PyQt application. Currently, there's a status panel (defined as a QWidget) which contains a QHBoxLayout. This layout is frequently updated with QPushButtons created by another portion of the application.
Whenever the buttons which appear need to change (which is rather frequently) an update effect gets called. The e...
I use the easy_install to install python packages in a virtuaenv under windows7. Due to the UAV, I have to run the CMD as administrator for installing packages. Here comes the problem, I notice that I can't import the package from a normal user account.
>>> import tempita
Traceback (most recent call last):
File "<stdin>", line 1, i...
django code:
return render_to_response(template_name, {
"form": form,
}, context_instance=RequestContext(request))
and html:
<script type="text/javascript">
var a='{{form}}'
alert(a)
</script>
it's error is 'unterminated string literal',
and i see this in firebug :
<script type="text/javascript">
...
Hi, I have a longitudinal data set generated by a computer simulation that can be represented by the following tables ('var' are variables):
time subject var1 var2 var3
t1 subjectA ...
t2 subjectB ...
and
subject name
subjectA nameA
subjectB nameB
However, the file generated writes a data file in a format similar to the f...
I have a csv file with different headers.
name,city
john doe,chicago
Have headers as
reader = csv.DictReader(open(PATH_FILE),skipinitialspace=True)
headers = reader.fieldnames
How will you run a regex that whenever a tag [name] was to be proceesed it will show "john doe"
...
hi guys. I live in China and the Great Firewall blocked Youtube and twitter. So I want to build a proxy server on google appengine in python to bypass that. Does anyone know any open source GAE project on that?
Thx~
...
I'm looking for a way to calculate multivariate version of Spearman rank correlation $\rho$. Are there any ready to use Python implementation I can use?
...
I want to simulate the game of life problem using python. I want to draw a grid and be able to color its cells as the simulation progresses. How do I do that in Python?
...