how to use concatenate a fixed string and a variable in Python

前端 未结 6 1550
借酒劲吻你
借酒劲吻你 2020-12-05 23:16

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 ma         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 23:46

    With python 3.6+:

    msg['Subject'] = f"Auto Hella Restart Report {sys.argv[1]}"

提交回复
热议问题