I am building Django +MySQL on dreamhost, but met the error messages:
Caught an exception while rendering: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY tag.used_count DESC, tag.name ASC' at line 1")
I traced hard and found the ...
I am using the subprocess package in Python to run a subprocess, which I later need to kill. However, the documentation of the subprocess package states that the terminate() function is only available from 2.6
We are running Linux with 2.5 and for backwards compatibility reasons I cannot upgrade to 2.6, what is the alternative? I am gue...
2009-06-30 23:36:28,483 ERROR appcfg.py:1272 An unexpected error occurred. Aborting.
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1250, in DoUpload
missing_files = self.Begin()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg....
I am adding MetaWeblog API support to a Django CMS, and am not quite sure how to layer the application.
I am using django_xmlrpc, which allows me to map to parameterised functions for each request. It is just a case of what level do I hook in calls to the django application from the service functions (AddPage, EditPage etc)
For django-...
I have found the following command in AWK useful in Vim
:'<,'>!awk '{ print $2 }'
Python may also be useful in Vim.
However, I have not found an useful command in Python for Vim's visual mode.
Which Python commands do you use in Vim?
...
Hi...I have this problem I've been trying to tackle for a while. I have a variable that is 17 characters long, and when displaying the variable on my form, I want it to display the last seven characters of this variable in bold...how do I go about this...I'd really appreciate anybody's insight on this.
...
When an exe file is run it prints out some stuff. I'm trying to run this on some numbers below and print out line 54 ( = blah ). It says process isn't defined and I'm really unsure how to fix this and get what I want printed to the screen. If anyone could post some code or ways to fix this thank you so very much!
for j in ('90','52.6226...
I'm thinking that I'm going to have to run monthly reports in Crystal Reports. I've read that you can automate this with COM/ActiveX but I'm not that advanced to understand what this is or what you can even do with it.
I'm fairly familiar with Python and it looks like from what I've read, I might be able to open the report, maybe cha...
I'm not sure how I would go about reducing the color palette of a PIL Image. I would like to reduce an image's palette to the 5 prominent colors found in that image. My overall goal is to do some basic color sampling.
...
Hi all,
I have been reading through this wonderful website regarding the recommended Python IDEs and have narrowed it down to either
WingIDE
KomodoIDE
which you guys will recommend for the purpose of developing Pylons apps? I know that most questions have been asked pertaining to Python IDEs but how about Python web framework IDEs w...
Cody has been building a Pythonic Macro Syntax. He says
These macros allow you to define
completely custom syntax, from new
constructs to new operators. There's
no facility for doing this in Python
as it stands.
I am not sure what he means by
new constructs to new operators: Does he prefer to binary operators such as +, -...
Hy,
is there any event-drive/event-based Webframework for Python?
I mean something like NitroGen is for erlang.
You simply get some components you add to a website (like a button) and accociate a python-function to the "onclick"-handler of the button and it gets executed. It should generate all needed html and js core for me (just as n...
I want to be able to display set of data differently according to url parameters.
My URL looks like /page/{limit}/{offset}/{format}/.
For example:
/page/20/0/xml/ - subset [0:20) in xml
/page/100/20/json/ - subset [20:100) in json
Also I want to be able to do the same for csv, text, excel, pdf, html, etc...
I have to be able to se...
I want to do a program and want make a the spawn like this process -> n process -> n process
can the second level spawn process with multiprocessing ? using multiprocessinf module of python 2.6
thnx
...
In a pylab program (which could probably be a matlab program as well) I have a numpy array of numbers representing distances: d[t] is the distance at time t (and the timespan of my data is len(d) time units).
The events I'm interested in are when the distance is below a certain threshold, and I want to compute the duration of these even...
Hello.
I'm working on my first object oriented bit of python and I have the following:
#!/usr/bin/python
import random
class triangle:
# Angle A To Angle C Connects Side F
# Angle C to Angle B Connects Side D
# Angle B to Angle A Connects Side E
def __init__(self, a, b, c, d, e, f):
self.a = a
self.b = b
self.c ...
hello,
how would you extract the domain name from a URL, excluding any subdomains?
My initial simplistic attempt was:
'.'.join(urlparse.urlparse(url).netloc.split('.')[-2:])
This works for http://www.foo.com, but not http://www.foo.com.au.
Is there a way to do this properly without using special knowledge about valid TLDs or country...
I found this Perl script while migrating my SQLite database to mysql
I was wondering (since I don't know Perl) how could one rewrite this in Python?
Bonus points for the shortest (code) answer :)
edit: sorry I meant shortest code, not strictly shortest answer
#! /usr/bin/perl
while ($line = <>){
if (($line !~ /BEGIN TRANSACTION...
The source code behind EveryBlock.com, a major Django-powered website founded by Adrian Holovaty, one of the co-Benevolent Dictators For Life of the Django framework, was recently open-sourced. The source is available as tarballs and on github.
This large body of code from an originator of Django should have some interesting features, p...
Hello,
link text
When I do :
tkMessageBox.askquestion(title="Symbol Display",message="Is the symbol visible on the console")
along with Symbol Display window tk window is also coming.
If i press "Yes"...the child window return yes,whereas tk window remains there.
Whenever I am tryng to close tk window, End Program - tk comes. on ...