[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] python bindings?



Welcome to the world of the Python bindings! What you have been returned is a ClassAd object, which will act very similar to a dict (and can be easily turned into a dict) but with some different properties:

https://htcondor.readthedocs.io/en/latest/apis/python-bindings/api/classad.html#classad.ClassAd

Two properties of ClassAd objects that you should immediately be aware of is
1. The keys are case-insensitive
2. The values can contain expressions (classad.ExprTree objects) that can reference ClassAd functions ( see https://htcondor.readthedocs.io/en/latest/misc-concepts/classad-mechanism.html ) and that can reference other keys ("attributes") that may or may not be in the ClassAd object you have been returned

Jason Patton

On Thu, Sep 3, 2020 at 10:10 AM <mdidomenico4@xxxxxxxxx> wrote:
i'm newish to python and definitely new to the python bindings for
htcondor.  I don't understand the return values

(this is all pseudo code)

for job in schedd.xquery(projection=[]):
  print(job)

the returned values are something like

[ blah = "blah";
  blah = "blah";
  blah = "blah"; ]

what i expected was that 'job' would be a dictionary that i could then
iterate or reference into like a normal key/value hash

i looked over the docs and tutorials, but i think i'm missing
something fundamental here
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/