I am trying to store the output of system
in a variable.
src_chksum = 'CertUtil -hashfile "C:\Users\Public\Videos\Wildlife.wmv" MD5'
print src_chksum
Output:
CertUtil -hashfile "C:\Users\Public\Videos\Wildlife.wmv" MD5
But the actual output is split across three lines:
MD5 hash of file C:\Users\abhishek.prusty\Desktop\wildlife.wmv:
d8 c2 ea fd 90 c2 66 e1 9a b9 dc ac c4 79 f8 af
CertUtil: -hashfile command completed successfully.
When I use system
before the backticks in the above code, only True
was returned and stored. Thanks to question 8753691, I removed system
and am only using the back ticks; I manage to store one line.
How do I do it when the output is split across multiple lines?