I'm using the Python C API to call Python functions from my application. I'd like to present a list of functions that could be called and would like to be able to limit this list to just the ones with the expected number of parameters.
I'm happy that I can walk the dictionary to extract a list of functions and use PyCallable_Check to fi...
I can see from the latest 8.2 (almost 1200 lines of code) twisted that I am missing something:
http://twistedmatrix.com/trac/browser/trunk/twisted/words/protocols/jabber/xmlstream.py
My copy (697 lines from 3 years ago) is in:
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/twisted/words/protocols/jabber/xmlst...
I have lots of directories with text files written using (g)vim, and I have written a handful of utilities that I find useful in Python. I start off the utilities with a pound-bang-/usr/bin/env python line in order to use the Python that is installed under cygwin. I would like to type commands like this:
%cd ~/SomeBook
%which pythonU...
Hi all,
I was wondering - how do people handle importing large numbers of commonly used modules within django views? And whats the best method to do this efficiently?
For instance, I've got some views like,
admin_views.py
search_views.py
.
.
and from what I've seen, every one of them needs to use HttpResponse or other such commonly ...
I've just written a chunk of code that strikes me as being far more nested than is optimal. I'd like advice on how to improve the style of this, particularly so that it conforms more with "Flat is better than nested."
for app in apps:
if app.split('.', 1)[0] == 'zc': #only look for cron in zc apps
try:
a = app + ...
The site that I'm trying to scrape uses js to create a cookie. What I was thinking was that I can create a cookie in python and then use that cookie to scrape the site. However, I don't know any way of doing that. Does anybody have any ideas?
...
HI,i got a multi-threading program which all threads will operate on oracle
DB. So, can sqlalchemy support parallel operation on oracle?
tks!
...
When you have a model field with a choices option you tend to have some magic values associated with human readable names. Is there in Django a convenient way to set these fields by the human readable name instead of the value?
Consider this model:
class Thing(models.Model):
PRIORITIES = (
(0, 'Low'),
(1, 'Normal'),
(2, '...
I do most of my development in Java and C++ but recently had to write various scripts and picked up Python. I run python from the command line on scripts; not in interactive mode. I'm wondering if
I like a lot of things about the language, but one thing that keeps reducing my productivity is the fact that I get no advance warning if I ...
I always get confused with licenses, I'm reading up again, but I'm sure someone out there already understands this and may be able to explain it more clearly.
I'm trying to get my company to use geodjango, and being a typical large enterprise company they don't want to open-source the resulting project. And therefore opposed to touchin...
Hi All,
Just starting to get to grips with python and MySQLdb and was wondering
Where is the best play to put a try/catch block for the connection to MySQL. At the MySQLdb.connect point? Also should there be one when ever i query?
What exceptions should i be catching on any of these blocks?
thanks for any help
Cheers
Mark
...
I have a php script that outputs a random image each time it's called. So when I open the script in a web browser, it shows one image and if I refresh, another image shows up.
I'm trying to capture the correct image from visiting the web site through a command line (via mechanize). I used urllib2.urlopen(...) to grab the image, but each...
I am writing an application to test a network driver for handling corrupted data. And I thought of sending this data using raw socket, so it will not be corrected by the sending machine's TCP-IP stack.
I am writing this application solely on Linux. I have code examples of using raw sockets in system-calls, but I would really like to kee...
Being relatively new to Python 2, I'm uncertain how best to organise my class files in the most 'pythonic' way. I wouldn't be asking this but for the fact that Python seems to have quite a few ways of doing things that are very different to what I have come to expect from the languages I am used to.
Initially, I was just treating classe...
I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive and do pretty good...
So, I started learning to code in Python and later Django. The first times it was hard looking at tracebacks and actually figure out what I did wrong and where the syntax error was. Some time has passed now and some way along the way, I guess I got a routine in debugging my Django code. As this was done early in my coding experience, I s...
You may know the Windows compliance tool that helps people to know if their code us supported by any version of the MS OS.
I am looking something similar for Python.
I am writing a lib with Python 2.6 and I realized that it was not compatible with Python 2.5 due to the use of the with keyword.
I would like to know if there is a simp...
Guys,
Im trying to engineer in python a way of transforming a list of integer values between 0-255 into representative equivalent tones from 1500-2200Hz. Timing information (at 1200Hz) is given by the (-1),(-2) and (-3) values. I have created a function that generates a .wav file and then call this function with the parameters of each to...
I am looking for a database library that can be used within an editor to replace a custom document format. In my case the document would contain a functional program.
I want application data to be persistent even while editing, so that when the program crashes, no data is lost. I know that all databases offer that.
On top of that, I wa...
I am currently evaluating for an eCommerce project. Is there any good Python based webshop software. Are there any personal experiences people can share?
Until now I have only found:
http://www.satchmoproject.com/
Coming from the PHP world finding only ONE project seams akward to me.
Does anybody have experience with Satchmo?
Ar...