python (43,091)


XML Processing in Python

XML Processing in Python

I am about to build a piece of a project that will need to construct and post an XML document to a web service and I'd like to do it in Python, as a means to expand my skills in it. Unfortunately, w…


Generate list of all possible permutations of a string

How would I go about generating a list of all possible permutations of a string between x and y characters in length, containing a variable list of characters. Any language would work, but it should b…


python Get a preview JPEG of a PDF on Windows?

I have a cross-platform(Python) application which needs to generate a JPEG preview of the first page of a PDF. On the Mac I am spawning sips. Is there something similarly simple I can do on Windows?…


python cx_Oracle: How do I iterate over a result set?

There are several ways to iterate over a result set. What are the tradeoff of each?…


performance Most efficient code for the first 10000 prime numbers?

I want to print the first 10000 prime numbers. Can anyone give me the most efficient code for this? Clarifications: It does not matter if your code is inefficient for n>10000. The size of the code…


Using 'in' to match an attribute of Python objects in an array

I don't remember whether I was dreaming or not but I seem to recall there being a function which allowed something like, foo in iter_attr(array of python objects, attribute name) I've looked over the…


Python and MySQL

I can get Python to work with Postgresql but I cannot get it to work with MySQL. The main problem is that on the shared hosting account I have I do not have the ability to install things such as Djan…


How do I use Python's itertools.groupby()?

I haven't been able to find an understandable explanation of how to actually use Python's itertools.groupby() function. What I'm trying to do is this: Take a list-in this case, the children of an…


python Adding a Method to an Existing Object Instance

I've read that it is possible to add a method to an existing object(i.e., not in the class definition) in Python. I understand that it's not always good to do so. But how might one do this?…



Bayesian filtering for spam

I was wondering if there is any good and clean oo implementation of Bayesian filtering for spam and text classification? This is just for learning purposes.…




example how from list java tutorial string for file get