To help further my understanding of WSGI I'm looking for a diagram which explains the flow of an application, from webserver (eg. apache) through a number of middlewares to "code" (as in, the print "hello world" bit).
I've read various articles regarding WSGI from wsgi.org, but it's still not "clicking" for me and as for diagrams Googl...
How can I check if a Python object is a string (either regular or Unicode)?
...
I'm about to begin my next web development project and wanted to hear about the merits of Lua within the web-development space.
How does Lua compare to PHP/Python/JSP/etc.. for web development?
Any reason why Lua would be a poor choice for a web application language vs the others?
...
How would I go about using Python to read the frequency peaks from a WAV PCM file and then be able to generate an image of it, for spectogram analysis?
I'm trying to make a program that allows you to read any audio file, converting it to WAV PCM, and then finding the peaks and frequency cutoffs.
...
Hello world,
Im trying to map a list into hex, and then use the list elsewhere. In python 2.6, this was easy:
A: python 2.6:
>>> map(chr,[66,53,0,94])
['B', '5', '\x00', '^']
However, on 3.1, the above returns a map object.
B: python 3.1:
>>> map(chr,[66,53,0,94])
<map object at 0x00AF5570>
How do i retrieve the mapped list (as...
Python's shutil.copytree is not very flexible; what is the simplest way to add support for ignoring permissions while copying in copytree (without having to re-write its implementation)?
Otherwise, copytree fails like this:
(…)”[Errno 45] Operation not supported: ‘/path/foo/bar’”
...
I've got Django set up to run some recurring tasks in their own threads, and I noticed that they were always leaving behind unfinished database connection processes (pgsql "Idle In Transaction").
I looked through the Postgres logs and found that the transactions weren't being completed (no ROLLBACK). I tried using the various transactio...
I installed python 2.6 on my mac (which ships with 2.5, and I am going crazy in working with 2.6) Everything has been installed on /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/. Now I want to install the python BerkeleyDB module, but it goes syntax error during the build:
creating build/temp.macosx-10.3-fat-2.6/ex...
I'm trying to set an option (xdebug.profiler_enable) in my php.ini file using python's ConfigParser object. here is the code:
section in php.ini file im trying to modify
[xdebug]
;XDEBUG SETTINGS
;turn on the profiler?
xdebug.profiler_enable=0
xdebug.profiler_append=1
xdebug.profiler_enable_trigger=0
xdebug.trace_output_name="%R"
xd...
Given:
dict = {"path": "/var/blah"}
curr = "1.1"
prev = "1.0"
What's the best/shortest way to interpolate the string to generate the following:
path: /var/blah curr: 1.1 prev: 1.0
I know this works:
str = "path: %(path)s curr: %(curr)s prev: %(prev)s" % {"path": dict["path"],"curr": curr, "prev": prev}
But I was hoping there ...
Hi all,
I am trying to write a Python consumer for Sage CRM using their Web Services interface. I am using SOAPpy as Python SOAP library (not married to it, was easy to install on Ubuntu so went with it).
Managed to fetch the WSDL using the Proxy and executed the logon method exposed by Sage CRM.
from SOAPpy import *
proxy = WSDL.P...
I'm trying to install py-appscript on the mac using 'sudo easy_install appscript'.
The command runs and I get a message saying "Installed /Library/Python/..../appscript=0.20.0-py2.5-maxosx-10.5-i386.egg".
However, when I run a tool that required this (osaglue) I get an error that py-appscript isn't installed. My guess is that it's insta...
import urllib
response = urllib.urlopen('http://pool.sks-keyservers.net/')
print 'RESPONSE:', response
print 'URL :', response.geturl()
headers = response.info()
print 'DATE :', headers['date']
print 'HEADERS :'
print '---------'
print headers
data = response.read()
print 'LENGTH :', len(data)
print 'DATA :'
print '--------...
I have setup the logging module for my new python script. I have two handlers, one sending stuff to a file, and one for email alerts. The SMTPHandler is setup to mail anything at the ERROR level or above.
Everything works great, unless the SMTP connection fails. If the SMTP server does not respond or authentication fails (it requires...
I have a model containing items, which has many different fields. There is another model which assigns a set of this field to each user using a m2m-relation.
I want to achieve, that in the end, every user has access to a defined set of fields of the item model, and he only sees these field in views, he can only edit these field etc.
Is ...
Hi
I've tried to install pip on windows, but it's not working:
giving me ImportError: No module named pkg_resources
easy_install doesn't have version 3.1 or so, just 2.5, and should be replaced by pim.
is there easy way to install it on windows?
...
Hi all,
I have a Python class
class pytest:
i = 34
def func(self):
return "hello world"
When I access pytest.i, I get 34. I can also do this another way:
a = pytest()
a.i
This gives 34 as well.
If I try to access the (non-existing) pytest.j, I get
Traceback (most recent call last):
File "<pyshell#6>", line 1, in ...
I run following python script.
pygame2exe.py
ImportError: No module named japanese
What's wrong?
Do not you know solutions?
...
I wrote this code.
import socket
host = 'localhost'
port = 3794
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.bind((host, port))
while 1:
print 'Type message you want to send...'
msg = raw_input()
...
Hi to all!
I have a question regarding editing/saving data in database using Django.
I have template that show data from database. And after each record i have link that link you to edit page.
But now is the question how to edit data in db without using admin panel?
I run thought tutorial in djangobook but i didn't see how to achieve...