I recently starting playing around with the new features of Python 3.1 and porting one of my 2.6 apps. I was surprised to find that MySQLdb does not yet support any of the 3.x versions of Python. My app uses MySQL extensively, so, as you can imagine, I didn't get too far!
What are my options (if any) for working with MySQL and Python ...
Hello, I'm writing a spider in Python to crawl a site. Trouble is, I need to examine about 2.5 million pages, so I could really use some help making it optimized for speed.
What I need to do is examine the pages for a certain number, and if it is found to record the link to the page. The spider is very simple, it just needs to sort thro...
How do you make a graph in networkx such that its layout is 2D, radial, and the edges are plotted in increasing edge lengths or weights?
...
Hi Everyone ,
I have written a small program to replace a set of characters , but i also want two or more replace command in a single program .
Apart from it i also want to add an bracket after random set of characters.
This is my Program
file_read=open('<%=odiRef.getOption("READ")%>/EXPORT.XML','r')
file_write=open('<%=odiRef.ge...
Hey,
I want to create a very simple python web app. I don't need Django or any other web framwwork like that. Isn't there a simpler way to create a web app in python?
Thanks
...
There are some similar questions, but none supply the answer I require.
If I create threads via threading.Thread, which then throw exceptions which are unhandled, those threads are terminated. I wish to retain the default print out of the exception details with the stack trace, but bring down the whole process as well.
I've considered...
I've made a nice form, and a big complicated 'add' function for handling it. It starts like this...
def add(req):
if req.method == 'POST':
form = ArticleForm(req.POST)
if form.is_valid():
article = form.save(commit=False)
article.author = req.user
# more processing ...
Now I don'...
Why do I never get the readyReadStandardOutput signal when I run the following?
import os, sys, textwrap
from PyQt4 import QtGui, QtCore
out_file = open("sleep_loop.py", 'w')
out_file.write(textwrap.dedent("""
import time
while True:
print "sleeping..."
time.sleep(1)"""))
out_file.close()
def started():
p...
stackless python didn't take a good usage of multi-core, so where is the point it should be faster than python thread/multiprocessing ?
all the benchmark use stackless python tasklet to compare with python thread lock and queue, that's unfair, cause lock always has low efficiency
see, if use single thread function call without lock i...
Hi,
I am trying to implement Google Authentication in my website, in which I would also be pulling some Google Data using the Google Data API and I am using Google App Engine with Jinja2.
My question is, so many ways are mentioned to do it. I am confused between Google Federated Login,Google Data Protocol, Hybrid Protocol. Are these ...
I am trying to to get all directories' name from an FTP server and store them in hierarchical order in a multidimensional list or dict
So for example, a server that contains the following structure:
/www/
mysite.com
images
png
jpg
at the end of the script, would give me a list such as
['/www/'
[...
What is the fastest way of converting records holding only numeric data into fixed with format strings and writing them to a file in Python? For example, suppose record is a huge list consisting of objects with attributes id, x, y, and wt and we frequently need to flush them to an external file. The flushing can be done with the followi...
Hi everyone,
I created a script that will tell me what to wear in the morning based on the weather (ie rain slicker if it will rain, heavy jacket if it will be cold, etc). I have fairly basic programming experience with python and the script works perfectly, but I want to be able to create a file that I can just double-click from my des...
I want to write a web application that allows users to enter any HTML that can occur inside a <div> element. This HTML will then end up being displayed to other users, so I want to make sure that the site doesn't open people up to XSS attacks.
Is there a nice library in Python that will clean out all the event handler attributes, <scri...
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
...
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to me...
How can I create a zip archive of a directory structure in Python?
...
Hey all!
So, basically what I'm trying to do is a hockey pool application, and there are a ton of ways I should be able to filter to view the data. For example, filter by free agent, goals, assists, position, etc.
I'm planning on doing this with a bunch of query strings, but I'm not sure what the best approach would be to pass along t...
Hi!
I am deploying my django application on a server, and on last stages I am getting this error:
ExtractionError at /admin/
Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Errno 13] Permission denied: '/.python-eggs'
The Python egg cache directory is current...
I have a Java class library (3rd party, proprietary) and I want my python script to call its functions. I already have java code that uses this library. What is the best way to achieve this?
...