TypeError: startswith first arg must be bytes or a tuple of bytes, not str

if line.startswith(’@’) and not flag:
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
python2的程序,在python3下运行会报错。
改用pyhton2后正常了。以后脚本中一定区分开python与python2和python3.

你可能感兴趣的:(出错)