PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON You have been asked to send a daily report via email cont
Posted: Mon May 09, 2022 5:51 am
PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON PYTHON
PYTHON
You have been asked to send a daily report via email containing
the ping times of key IP addresses. The list of IP addresses to
ping is provided in a file named ip.csv
(attached). You will need to read this file, ping each IP
address and send an email to yourself containing the data.
ip.csv
----------------------------
ip
127.0.0.1
192.168.0.1
8.8.8.8
1.1.1.1
8.8.4.4
9.9.9.9
208.67.222.222
208.67.220.220
-------------------------------
In order to send email programmatically through GEMail you will
need to create a Google Cloud project and enable the GEMail APIs.
This is covered in Chapter 18 of the textbook and the lab links to
a video walkthrough showing you how to set up API access using your
@mail.school.edu account.
During the setup process you will be prompted to save a file to
your computer. Be sure to save it where your python script will be
located.
You will also need to install a few python libraries using pip.
See Appendix A in the textbook regarding third-party
installations.
pip install ezgEmail
pip install ping3
Once your script is written a browser window will pop up and you
must authenticate to Google using your @mail.school.edu. This
process only needs to be done once and gives the script permissions
to send email on your behalf.
Note: If you receive a [WinError 10013] socket access
error on a Windows machine you may need to run the program
with administrative rights, either through IDLE or the command
line.
Note: If you are using a personal gEmail
account you may get an Error 403: access_denied message
when attempting to log in, if so please review this short youtube
video.
The above image is a screenshot of the email sent by the Python
program. The email in the image above is from a student email and
contains the following text:
127.0.0.1 0.0004279613494873047
192.168.0.1 0.0071620941162109375
8.8.8.8 None
1.1.1.1 None
8.8.4.4 None
9.9.9.9 None
208.67.222.222 None
208.67.220.220 False
(Notice that if your firewall is blocking pings some sites may
show none or false)
The program must:
read the provided CSV file
ping the IP addresses and store the data
send an email containing the IP data on your behalf
PYTHON
You have been asked to send a daily report via email containing
the ping times of key IP addresses. The list of IP addresses to
ping is provided in a file named ip.csv
(attached). You will need to read this file, ping each IP
address and send an email to yourself containing the data.
ip.csv
----------------------------
ip
127.0.0.1
192.168.0.1
8.8.8.8
1.1.1.1
8.8.4.4
9.9.9.9
208.67.222.222
208.67.220.220
-------------------------------
In order to send email programmatically through GEMail you will
need to create a Google Cloud project and enable the GEMail APIs.
This is covered in Chapter 18 of the textbook and the lab links to
a video walkthrough showing you how to set up API access using your
@mail.school.edu account.
During the setup process you will be prompted to save a file to
your computer. Be sure to save it where your python script will be
located.
You will also need to install a few python libraries using pip.
See Appendix A in the textbook regarding third-party
installations.
pip install ezgEmail
pip install ping3
Once your script is written a browser window will pop up and you
must authenticate to Google using your @mail.school.edu. This
process only needs to be done once and gives the script permissions
to send email on your behalf.
Note: If you receive a [WinError 10013] socket access
error on a Windows machine you may need to run the program
with administrative rights, either through IDLE or the command
line.
Note: If you are using a personal gEmail
account you may get an Error 403: access_denied message
when attempting to log in, if so please review this short youtube
video.
The above image is a screenshot of the email sent by the Python
program. The email in the image above is from a student email and
contains the following text:
127.0.0.1 0.0004279613494873047
192.168.0.1 0.0071620941162109375
8.8.8.8 None
1.1.1.1 None
8.8.4.4 None
9.9.9.9 None
208.67.222.222 None
208.67.220.220 False
(Notice that if your firewall is blocking pings some sites may
show none or false)
The program must:
read the provided CSV file
ping the IP addresses and store the data
send an email containing the IP data on your behalf