I want to include file name 'main.txt' in the subject for that I am passing file name from command line. but getting error in doing so
python sample.py main.txt #running python with argument
msg['Subject'] = "Auto Hella Restart Report "sys.argv[1] #line where i am using that passed argument
If you need to add two strings you have to use the '+' operator
hence
and also you have to import sys in the begining
as
for integer type ...
Just try
The + operator is overridden in python to concatenate strings.
I'm guessing that you meant to do this: