This Code allows you to make barcode using other code file to enter the Information
# import EAN13 from barcode module
from barcode import Code128
import Data_base
from Data_base import df
# import ImageWriter to generate an image file
from barcode.writer import ImageWriter
import pandas
# Make sure to pass the number as string
# Now, let's create an object of EAN13 class and
# pass the number with the ImageWriter() as the
# writer
# Our barcode is ready. Let's save it.
for index, row in df.iterrows():
number = (str(row["id"]))
print(str (row['id'])+"@eriesd.org")
my_code = Code128(number, writer=ImageWriter())
my_code.save(row["id"])
The Barcode took csv file of the student that used for the bar code and the outlook malls
import win32com.client as win32
import os
from Data_base import *
olApp = win32.Dispatch('Outlook.Application')
olNS = olApp.GetNameSpace('MAPI')
for index, row in df.iterrows():
id = row['id']
recipient = (str (id)+"@eriesd.org")
mailItem = olApp.CreateItem(0)
mailItem.Subject = 'Hello 123'
mailItem.BodyFormat = 1
mailItem.Body = 'Hello There'
mailItem.To = recipient
mailItem.Sensitivity = 2
mailItem.Attachments.Add(os.path.join(os.getcwd(), f'{id}.png'))
mailItem.Save()
mailItem.Send()