Skip to content

Instantly share code, notes, and snippets.

View theDreamer911's full-sized avatar

Handhika Yanuar Pratama theDreamer911

View GitHub Profile
@theDreamer911
theDreamer911 / extract_image_from_docx_file.py
Last active July 14, 2022 02:03
This program will help extracting image from document files
import docx2txt
input_loc = input("Your docx location: ")
output_loc = input("Output location: ")
text = docx2txt.process(input_loc.split('"')[1], output_loc.split('"')[1])
import pandas as pd
def country_info(country):
df_country = pd.read_html("https://tradingeconomics.com/matrix")[0]
info = df_country.loc[df_country["Country"] == country]
country_check = (df_country[df_country["Country"] == country]).all(1).any()
## Use for creating country.txt (List for all available country)
# with open("country.txt", "w") as f:
@theDreamer911
theDreamer911 / create_name.py
Created February 12, 2022 16:00
This code is for built CSV with Python
name = input("Filename: ")
n = int(input("How many data: "))
print("\a")
for i in range(n):
print("Data Number-" + str(i+1))
first = str(input("First name: "))
last = str(input("Last name: "))
print("\a")
with open(f"{name}", "a") as f:
@theDreamer911
theDreamer911 / youtube_scraping.py
Created October 23, 2021 17:07
this extended version of youtube comment scrapper python modules
from youtube_comment_scraper_python import *
import pandas as pd
link = input("Youtube links: ")
saved = input("Output name: ")
youtube.open(link)
response = youtube.video_comments()
data = response['body']
#################################################
################### MODULE ######################
#################################################
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
#################################################
####################################
########## INFORMATION #############
LANGUAGES = {
'af': 'afrikaans',
'sq': 'albanian',
'am': 'amharic',
'ar': 'arabic',
'hy': 'armenian',
'az': 'azerbaijani',
'eu': 'basque',
'be': 'belarusian',
'bn': 'bengali',
def flip(text, arr):
return sorted(arr) if text == 'R' else sorted(arr, reverse=True)
const fetch = require("node-fetch");
fetch("https://type.fit/api/quotes")
.then((response) => response.json())
.then((data) => console.log(data[Math.floor(Math.random() * 1000)]));