This is a silly question, but it's giving me a lot of trouble. I'm trying to capture an output into a variable
a='jobid'
p=exec(a)
print(p)
output:None
You guys might say why not just use the variable 'a' rather than executing it, but I have a cascading function next to it. And I can't use the variable 'a'.And the value 'job ID' in the variable 'a' comes from a data frame and needs to catch value, as 'job ID' is a parameter in my code. Can anyone please help me out?
I also tried the below code:
a='jobid'
p=exec('print(jobid)')
print(p)
But it didn't worked out.