I recently downloaded python 2.7 on my computer (x64) and I would like to install mod_python for it (I have apache 2.2), however, I can't find a mod_python release supporting python 2.7. Has development stopped? If so, what should I use instead?
...
I've been trying to Base64 encode image data from the user (in this case a trusted admin) in order to skip as many calls to the BlobStore as I possibly can. Every time I attempt to encode it, I recieve an error saying:
Error uploading image: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128)
I've googled the...
I need to:
draw 3d models with specific 3ds textures
have the models be moving (just position)
have a camera viewer which is easily maneuverable (ideally in real time)
I would like to accomplish this with Python and OpenGL. What would be the best libraries to accomplish this and what are some good resources to read up on?
Thanks in ...
The site I'm trying to spider is using the javascript:
request.open("POST", url, true);
To pull in extra information over ajax that I need to spider. I've tried various permutations of:
r = mechanize.urlopen("https://site.tld/dir/" + url, urllib.urlencode({'none' : 'none'}))
to get Mechanize to get the page but it always results in...
I need to concatenate string to an existing one as follows.
for k,v in r.iteritems():
tableGenString += "%s %s, " % (k, what_type(v))
The problem is that for the last item the comma(',') should not be added.
How can I check if k,v is the last item?
Added
The example is a simplified version of the real code as follows.
for k,v ...
How many items can contain tuple or list in python? What will be if it is 10 000?
...
I have a string as follows
CompilationStatistics_Compilation_StepList_Map_TimingUsage_ClockList_Clock_MinimumPeriod
What would be the simplest way to remove the first part (CompilationStatistics_) or the last part (_MiniumuPeriod)?
I think about using regular expression, but I expect there should a better way.
m = re.search("{.+}_...
Hi,
Is there any library (java/python) that allows to make msn bots that support set/get display images. So far i've jml-java but it fails to set display image in wlm clients. I've checked twisted msn but it supports only msnp8.
Is there somebody who's already implemented the protocol or could merely guide me so that i may implement th...
Whats the best to make a job ID counter in python? For example if a Job ID startd of with value of "0" and everytime someone ran the script the counter went up by one?
E.G.
X = 0
Perform_some_process
x +=1
Now the value of x will be one, but if i ran the script again x will be equal to one again and not two. How would make so when ...
From the official documentation I can't understand what is default parameter.
obj, created = Person.objects.get_or_create(first_name='John', last_name='Lennon',
defaults={'birthday': date(1940, 10, 9)}
Does it mean that it will look for fields which match both John and Lennon parameter and birthday will just insert? ...
Similar to my other post I have created a new little utility and wanted to get some feedback if there is a way to make my script more Pythonic per say. It is a simple tool for Windows that removes empty directory from the Program Files directory because sometimes programs leave behind an empty directory when they uninstall.
import os
d...
I've read over this question and I think that is a great start, but I'm looking for more insight.
I have written an application using Python 2.6 and Django 1.2.1.
I would like to deploy this application on a system that does not have Python 2.6 or Django installed. The system itself doesn't have many things installed - sqlite3, pysqlite...
I have 2 csv files:
output.csv
output1.csv
output.csv has a 5 columns of titles.
output1.csv has about 40 columns of different types of data.
I need to append all the content of output1.csv to output.csv. How can I do this?
could somebody please give me a hint on how to go about it ???
i have the following code :
reader=csv.DictRe...
When the following code is executed:
q = MyKind.all()
taskqueue.add(url="/admin/build", params={'cursor': q.cursor()})
I get:
AssertionError: No cursor available.
Why does this happen? Do I need to fetch something first? (I'd rather not; the code is cleaner just to get the query and pass it on.)
I'm using Python on Google ...
hi, well this is my problem, i'm working in a script (python) to find some files, i compare names of files against a regular expression pattern, now, i have to find files ended with a "~" (tilde), so i builded the next regex:
if re.match("~$", string_test):
print "ok!"
well, python seems to not recognize the regex, i dont know why...
How do I fix this?
PS: On googling, I found that this is some httplib2 bug but I didn't understand how to use the patches people have provided.
Traceback (most recent call last):
File "alt_func.py", line 18, in <module>
func(code)
File "alt_func.py", line 9, in func
resp, content = h.request(url_string, "GET", headers={'...
i want ro remove specific lines from the following csv file :
"Title.XP PoseRank"
1VDV-constatomGlu-final-NoGluWat.
1VDV-constatomGlu-final-NoGluWat.
P6470-Usha.1
P6470-Usha.2
P6470-Usha.3
P6470-Usha.4
P6470-Usha.5
P6515-Usha.1
P6515-Usha.2
P6517.1
P6517.2
P6517.3
P6517.4
P6517.5
P6553-Usha.1
P6553-Usha.2...
I'm rolling my own custom registration module in Django based on django.contrib.auth. My registration module will have some extra functionality and help me reduce my dependency on other django modules that I'm currently using like django-registration and django-emailchange. I've run into a what-the-best-way-to-do-it problem here.
Note: ...
Hi all,
I am working on a Django project, where I need to implement full text search. I have seen SOLR and found some good comments for the same. But as its implemented in Java and would need java enviroment to be installed on the system along with Python. Looking for the python equivalent for SOLR, I have seen Whoosh but I am not sure ...
Hi,
in python, if i want to keep a process or thread running forever, i can typically do this with an empty while loop:
while 1:
pass
this, however, will eat an unfair amount of CPU process. Adding a short sleep would work
import time
while 1:
time.sleep(0.01)
Is there any best and cleaner way of doing this? Thanks
...