I'm having trouble storing and outputting an ndash character as UTF-8 in Django.
I'm getting data from an API. In raw form, as retrieved and viewed in a text editor, given unit of data may be similar to:
"I love this detergent \u2013 it is so inspiring."
(\u2013 is & ndash; as an html entity).
If I get this straight from an API and...
I'm test building a scraping site with django. For some reason the following code is only providing one picture image where i'd like it to print every image, every link, and every price, any help? (also, if you guys know how to place this data into a database model so I don't have to always scrape the site, i'm all ears but that may be a...
I have a loop that executes the body about 200 times. In each loop iteration, it does a sophisticated calculation, and then as debugging, I wish to produce a heatmap of a NxM matrix. But, generating this heatmap is unbearably slow and significantly slow downs an already slow algorithm.
My code is along the lines:
import numpy
import ma...
I have a bit of code that runs through a dictionary and outputs the values from it in a CSV format. Strangely I'm getting a couple of blank lines where all the output of all of the dictionary entries is blank. I've read the code and can't understand has anything except lines with commas can be output. The blank line should have values...
I'm trying to do a simple script in Python that will print hex values and increment value like this:
char = 0
char2 = 0
def doublehex():
global char,char2
for x in range(255):
char = char + 1
a = str(chr(char)).encode("hex")
for p in range(255):
char2 = char2 + 1
b = str(chr(char...
I am maintaining a Python program, and am struggling to understand the relationships between the various classes. I think it would be helpful to see a diagram of how the classes interact.
What options are there available that might allow me to do this?
...
Hi.
What is the best way to create a new empty list in Python?
l = []
or
l = list()
I am asking this because of two reasons:
Technical reasons, as to which is faster. (creating a class causes overhead?)
Code readability - which one is the standard convention.
...
which is the best framework to handle file uploads on gae ,
thanks
...
I have a script which runs inside a while loop and monitors a mysql data source every 2 seconds. If I run if from the command line, it runs and works fine. But If I attach it to a daemon, it throws an error saying "MySQL has gone" or something similar. I checked and found MySQL up and running. I could even execute queries from other tool...
I have downloaded the zip archive (my only option) and installed it as suggested by unzipping into the dropin folder. When I try to start a project the problem occurs:
"Plug-in org.python.pydev was unable to load class org.python.pydev.ui.wizard.project.PythonProjectWizard"
I've googled and the only suggestion is to re-download and re-...
I've been looking at twisted for a while now. It looks interesting - it seems like a good way to leverage a lot of power when writing servers. Unfortunately, in spite of writing a few web servers using twisted.web (from reading other people's source and an extremely dated O'Reilly book) I've never really felt like I had reached an affini...
Hi
How do I do a check in python that a date appears in the last year. i.e. date between now and (now-1 year)
Thanks
...
Hello,
I want to know if it's possible to control "Microsoft Speech Recognition" using c#.
Is it possible, for instance, to simulate the click on "On: Listen to everything I say" programmatically using c# or python?
...
WTForms is a forms validation and rendering library for python web development
and i write this code to check two password is or not same :
from wtforms import Form, BooleanField, TextField, validators
class SignUpForm(Form):
username = TextField('Username', [validators.Length(min=4, max=25)])
email = TextField('Email', [...
hello
i have a microblog app, and i'm trying to paginate the entries, to show only 10 per page, for example.
though i've followed the tutorial, my pagination doesn't seem t be working.
the listing function looks like that:
def listing(request):
blog_list = Blog.objects.all()
paginator = Paginator(blog_list, 10)
try:
...
Does anyone know a way to get the amount of space available on a Windows (Samba) share via Python 2.6 with its standard library? (also running on Windows)
e.g.
>>> os.free_space("\\myshare\folder") # return free disk space, in bytes
1234567890
...
I have been trying to debug the below python cgi code but doesn't seems to work. When i try in new file it these three lines seems to work
filename=unique_file('C:/wamp/www/project/input.fasta')
prefix, suffix = os.path.splitext(filename)
fd, filename = tempfile.mkstemp(suffix, prefix+"_", dirname)
But, when i try like this way then i...
I am currently trying to port a legacy Python app over to .NET which contains AES encrpytion using from what I can tell pyCrpyto. I have very limited Python and Crypto experience. The code uses the snippet from the following page. http://www.djangosnippets.org/snippets/1095/
So far I believe I have managed to work out that it that it ca...
I need to create a chat similar to facebook chat.
I am thinking to create a simple application Chat and then using ajax polling ( to send request every 2-3 seconds ).
Is this a good approach ?
...
If you call the same logging handler from two different python threads, is there a need for locking?
...