Browsing Questions About python (1)



XML Processing in Python

I'm about to build a piece of a project that will need to build 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 there. Unfortunately, while I know the XML model fairly well in .Net, I'm uncertain what the pros and cons are of the XML models…

How can I find the full path to a font from its display name on a Mac?

I am using the Photoshop's javascript API to find the fonts in a given PSD. Given a font name returned by the API, I want to find the actual physical font file that that corresponds to on the disc. This is all happening in a python program running on OSX so I guess I'm looking for one of…

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?

Continuous Integration System for a Python Codebase

I'm starting work on a hobby project with a python codebase and would like to set up some form of continuous integration (i.e. running a battery of test-cases each time a check-in is made and sending nag e-mails to responsible persons when the tests fail) similar to CruiseControl or TeamCity. I…

cx_Oracle - what is the best way to iterate over a result set?

There are several ways, what is the best one?

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 docs but this kind of thing doesn't fall under any obvious listed headers

Is there an IDE that provides code completion for Python

I am quite fond of the Intellisense code completion baked into Microsoft Visual Studio. I find that I only type 2 to 4 characters of any given keyword which drasticaly speeds up my coding. Now that I have been spending time writing some Python code I find myself reaching for ctrl+space. Are t…

Class views in Django

Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach. For example, I have a page that displays…

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 Django or PySQL, I generally fail when installing them on my computer so maybe it's good I can't instal…

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 objectified lxml element - divide it into groups based on some criteria, and then later iterate over…

How to learn Python: Good Example Code?

I have been dabbling in Python for a couple months now, read the online docs/tutorial and started playing with Django a bit as well... and I feel like I am starting to leave my formative toddler years and ready for some more serious code. Most everything I see is generally encapsulated in a single…

Adding a Method to an Existing Object

I've read that it is possible to add a method to an existing object (e.g. not in the class definition) in python , I think this is called Monkey Patching (or in some cases Duck Punching). I understand that it's not always a good decision to do so. But, how might one do this? And if you don't …

What is the most efficient graph data structure in Python?

I need to be able to manipulate a large (10^7 nodes) graph in python. The data corresponding to each node/edge is minimal, say, a small number of strings. What is the most efficient, in terms of memory and speed , way of doing this? A dict of dicts is more flexible and simpler to implement, …

How do you express binary literals in Python?

How do you express an integer as a binary number with Python literals? I was easily able to find the answer for hex: >>> 0x12AF 4783 >>> 0x100 256 and, octal: >>> 01267 695 >>> 0100 64 How do you use literals to express binary in Python? Summary of Answers …

Next Page >