Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Huang Chen-Yi titaneric

🎯
Focusing
View GitHub Profile
@titaneric
titaneric / data.csv
Created Oct 7, 2020
Solution for @loser113 at PTT
View data.csv
A B C D
1 2 3 4
2 3 4 5
5 6 7 8
2 3 4 6
@titaneric
titaneric / PTT.ipynb
Last active Dec 15, 2019
MultiIndex problem for @CK0201
View PTT.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test.log
Jan 2 07:50:41 clftp1 ftpd[14459]: NOOP
Jan 2 07:50:41 clftp1 ftpd[14459]: CWD //MG11T36.1
Jan 2 07:50:41 clftp1 ftpd[14459]: PORT
Jan 2 07:50:41 clftp1 ftpd[14459]: LIST
View ptt.py
l = ["1060501", "1. AAA 2. BBB", "ID1234", "1060502", "1. BBB", "ID0000"]
selected_list = [l[i] for i in range(0, len(l), 3) if "AAA" in l[i+1]]
print(selected_list)
View OCR.py
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import urllib.request
from PIL import Image
from selenium.webdriver.support.select import Select
from PIL import ImageEnhance
import matplotlib.pyplot as plt
import cv2
import numpy as np
import urllib.request
@titaneric
titaneric / ptt.py
Created Nov 27, 2017
To vidmle @ptt-python
View ptt.py
import json
from urllib.request import urlopen
with urlopen("http://opendata2.epa.gov.tw/AQI.json") as url:
text = url.read().decode("utf8")
json_list = json.loads(text)
with open("AQI.json", "w", encoding="utf8") as f:
json.dump(json_list, f, ensure_ascii=False)