I am new to python and researched a log (probably the wrong way) and now decided to ask:
I have a bash script, which outputs two values. In a python script I invoke this this script by
subprocess.Popen(...skript details...)
(output, err) = p.communicate()
p_status = p.wait()
print "Command output : ", output
print "Command exit status/return code : ", p_status
value1, value2 = output.split(' ',1)
If I now add
print value1
I get what I expect (a numeric value).
Now I got some code from github to post data within a python script using curl. This builds the body like
body='{"mode":"async", "messageType":"1", "messages":[{"Name of Value1":value1, "Name of Value2":value2}]}'
However, what gets posted is the text "value1" and "value2" and not the actual values of the variables. I tried a lot of masking here but could not get any valuable result. Thx in advance