This is a pretty basic script, just wanting to grab some values from commandline and insert them into variables take those and calculate percentage.
import os
files = os.system('ls ../files/ | wc -l')
matches = os.system('wc -l ../text/burn.roto_02 | awk \'{print $1}\'')
percent=(files/matches)*100
print percent
I'll also need to tack a '.0' at the end of those variables so it returns a true value. example:
percent=(files.0/matches.0)*100
Running the below I get my expected value, but it is the variable which hangs things up for me.
python -c "percent=(20.0/100.0)*100;print percent"
20.0
Thanks!
import os
files = os.system('ls ../files/ | wc -l')
matches = os.system('wc -l ../text/burn.roto_02 | awk \'{print $1}\'')
percent=(files/matches)*100
print percent
I'll also need to tack a '.0' at the end of those variables so it returns a true value. example:
percent=(files.0/matches.0)*100
Running the below I get my expected value, but it is the variable which hangs things up for me.
python -c "percent=(20.0/100.0)*100;print percent"
20.0
Thanks!