Ack! Disregard the previous VI, it is somewhat broken. I've attached a new one to this comment that works much better. The previous VI wouldn't let you use any Python builtin functions.
Note: in order for LabVIEW to get the result of the executed the Python code, the result must be stored in a global variable named 'result'. The VI always interprets the result as a string, but it would be trivial to make it interpret it as a number instead (i.e. replace PyObject_Str() and PyString_AsString() with PyInt_AsLong())