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

前端 未结 6 1552
借酒劲吻你
借酒劲吻你 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:24

    I'm guessing that you meant to do this:

    msg['Subject'] = "Auto Hella Restart Report " + sys.argv[1]
    # To concatenate strings in python, use       ^ 
    

提交回复
热议问题