Category:Thai films about revenge
Category:Thai comedy films
Category:Thai horror films
Category:Thai thriller films
Category:Thai films
Category:Thai-language films
Category:2000s comedy horror films
Category:Thai ghost films
Category:2000s ghost films
Category:Thai comedy horror films
Category:2000s horror thriller filmsQ:
How to save output from a C program to a file using subprocess
This program calculates how many minutes to take the following numbers.
Is it possible to save the results of subprocess and the print() to the file?
The code:
import time
import os
os.system('cls')
print('Inicial time')
ini = time.time()
print('El resultado de inicio de temporizacion sera'+ str(ini-3*60) +'minutos')
os.system('cls')
print('FINAL time')
fin = time.time()
print('El resultado de fin de temporizacion sera'+ str(fin-2*60) +'minutos')
print('Mes:')
print(str(int(fin-3*60)-int(ini)))
print('Dias:')
print(str(int(fin-3*60)-int(ini)-int(fin-4*60)))
print('min:')
print(str(int(fin-3*60)-int(ini)-int(fin-4*60)))
print('minutes')
os.system('cls')
print()
print('Se cumple la temporizacion a.')
os.system('cls')
print('El resultado de temporizacion de'+ str(ini-3*60) +'minutos es de'+ str(fin-2*60) +'minutos.')
import subprocess
subprocess.call(['cls'])
print('Resultado de temporizacion')
file=open('temporizacion.txt','w')
file.write(str(ini-3*60) +'minutos')
file.close()
A:
This should do it:
import time
import os
import ac619d1d87
Related links:
Comments