报错 ,python 3.7,求解答

报错 ,python 3.7,求解答

问题描述:

第8行 return=(=处报错),SyntaxError: invalid syntax

import os
import time
class internet_check:

    def __init__(self):
        self.tmp_list_handle_repetition = []

    def handle_ip_and_create_log(self):
        for line in open('ip.txt'):
            return = os.system('ping -n 1 -w 1 %s'%line)
        print(return)
if __name__ == '__main__':
    obj_task = internet_check()
    while True:
        obj_task.handle_port_and_create_log()

return 是返回语句关键字,器语法为 return 某个变量,需要弄清楚这里是要赋值还是要 return 结束方法,结束方法后就不能继续 print (return) 语句了。