This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Code by Collins Chemjor | |
import os | |
import smtplib | |
from email.message import EmailMessage | |
from datetime import date | |
#Setting email address and password to be used | |
EMAIL_ADDRESS = os.environ.get('EMAIL_USER') | |
EMAIL_PASSWORD = os.environ.get("EMAIL_PASS") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
from csv import writer | |
def file_writing(client): | |
#Function to write client details to a csv file (later to import into excel) | |
with open("clients.csv", mode = "a") as file: | |
csv_writer = writer(file) | |
csv_writer.writerow(client) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This is code to remove "," and "'" in code | |
#importing regex module | |
import re | |
#Final Storage array | |
final_name = [] | |
#Defining our regex that will remove commas(,) and apostrophes('), however it will ignore spaces | |
#This is a test / example code, replace with your own | |
names = ["Cow","Chick'en", "Crick,et", "Bu'll", "She,e,p"] | |
#The regex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Code to scrape https://icanhazdadjoke.com/ | |
#It will generate one joke from terminal | |
#You need to install the following modules: requests, bs4, pyfiglet and termcolor (You can use pip) | |
import requests | |
from bs4 import BeautifulSoup | |
from random import choice | |
from pyfiglet import figlet_format | |
from termcolor import colored | |
value = "" |