Re: passing Python assignment value to shell

2014-05-28 Thread Cameron Simpson
On 28May2014 21:48, Satish Muthali wrote: This is what I went about doing: reecalc = [s.split() for s in os.Popen("free -ht").read().splitlines()] I think you dropped an "f" in your cut/paste. Try to be precise. freecalc_total = freecalc[4] freecalc_total = freecalc_total[3] fre

Re: passing Python assignment value to shell

2014-05-28 Thread Satish Muthali
Hello Experts, I was able to figure this out after spending time reading the Python help docs. This is what I went about doing: > reecalc = [s.split() for s in os.Popen("free -ht").read().splitlines()] > freecalc_total = freecalc[4] > freecalc_total = freecalc_total[3] > freecalc_total = freeca

Re: passing Python assignment value to shell

2014-05-28 Thread Ben Finney
Satish Muthali writes: > so, this is what I have so far: Thank you for presenting your code. Please ensure that you post in text only, without transforming the characters from what you typed. Something in your message composition process is currently converting some ‘"’ (U+0022 QUOTATION MARK)

Re: passing Python assignment value to shell

2014-05-28 Thread John Gordon
In Satish Muthali writes: > Now I want to feed the value for 'freecalc_total' as an argument to > a command executed by the shell. > For example: > devnull = open(os.devnull, 'w') > runCommand = subprocess.call(['stressapptest', ' the value of freecalc_total here>'], stdout=devnull,stderr=sub