How to append and save a print function to excel or csv
code :
firstpts= ['20']
for pfts in firstpts:
try:
(Operation)
print('test11 : PASSED')
except:
(Operation)
print('test11 : FAILED')
secondpts= ['120']
for sfts in secondpts:
try:
(Operation)
print('test22 : PASSED')
except:
(Operation)
print('test22 : FAILED')
If i run this code i"ll get this in output
test11 : PASSED
test22 : FAILED
How to redirect that outputs of all try-except cases to a csv