python snippets

partial snippet from a project automating running executables (in this case powershell) from a webpage ui (flask) and displayed the output on the webpage

import subprocess
filePath='c:\\test\\filebackup\\test.md'
print(filePath)


thing = subprocess.check_output(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", ". \"./test/test\";","fileBackup", "-scriptname", filePath])
print(str(thing,'utf-8'))

Comments