This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<form action='' method='POST' name='form'> | |
<label for="fname">Name:</label><br> |
This file contains hidden or 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
var TO_ADDRESS = "ENTER_YOUR_EMAIL_ID_HERE"; | |
// spit out all the keys/values from the form in HTML for email | |
// uses an array of keys if provided or the object to determine field order | |
function formatMailBody(obj, order) { | |
var result = ""; | |
if (!order) { | |
order = Object.keys(obj); | |
} | |
This file contains hidden or 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
from dateutil.relativedelta import * | |
from dateutil.easter import * | |
from dateutil.rrule import * | |
from dateutil.parser import * | |
from datetime import * | |
now = parse("Tue 11 17:13:46 Dec UTC 2020") | |
today = now.date() | |
year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year | |
rdelta = relativedelta(easter(year), today) | |
print("Today is: %s" % today) |
This file contains hidden or 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
''' | |
content.yaml | |
cities: | |
- London | |
- Kosice | |
- Los Vegas | |
- Delhi | |
- Trencin | |
companies: | |
- Microsoft |
This file contains hidden or 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
from pynput.keyboard import Key, Controller,Listener | |
import time | |
keyboard = Controller() | |
keys=[] | |
def on_press(key): | |
global keys | |
string = str(key).replace("'","") | |
keys.append(string) | |
main_string = "".join(keys) | |
print(main_string) |
This file contains hidden or 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
from googletrans import Translator , LANGUAGES | |
from googletrans.models import Translated | |
language = list(LANGUAGES.values()) | |
translator = Translator() | |
translated=translator.translate(text="How are You??", src = 'english', dest = 'hindi') | |
print(translated) |
This file contains hidden or 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
from googlesearch import search | |
query = 'what is machine learning?' | |
for j in search(query, tld="co.in", num=1, stop=5, pause=2): ## it will return a total of 5 links | |
print(j) |
This file contains hidden or 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
from PIL import Image, ImageOps | |
img1 = Image.open("img.png") ## Load a imge | |
img1.show() | |
img2 = ImageOps.grayscale(img1) ## gray scale | |
img2.show() |
This file contains hidden or 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 wikipedia | |
query = 'Narendra Modi' | |
results = wikipedia.summary(query, sentences=2) ## change the number of sentence to get a larger words summary | |
print(results) |
This file contains hidden or 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 speech_recognition as sr | |
r = sr.Recognizer() | |
with sr.Microphone() as source: | |
t_end = time.time() + 5 | |
while time.time() < t_end: | |
print("karl: Listening...") | |
audio=r.listen(source) | |
try: | |
query = r.recognize_google(audio) | |
print(f"user:{query}") |