Accessing program variables from Python