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
from multiprocessing.connection import Client | |
import time | |
from ppadb.client import Client as AdbClient | |
from com.dtmilano.android.viewclient import ViewClient | |
adb_conf=dict(host='127.0.0.1', port=5037) | |
cur_client=AdbClient(**adb_conf) | |
cur_devices=cur_client.devices()[0] |
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 pyautogui as p | |
import cv2 | |
import pytesseract | |
p.screenshot("test.jpg") | |
img=cv2.imread('test.jpg') | |
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) |
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
from flask import Flask, render_template_string | |
import time | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template_string('''<p>This is the current value: <span id="latest_value"></span></p> | |
<script> |
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
def calc_timeDelta(reference_time:str,days,hours,minutes,time_format)->str: | |
calced_time=datetime.strptime(reference_time,time_format)+timedelta(days=days,minutes=minutes,hours=hours) | |
return calced_time | |
# test | |
time_format="%Y-%m-%d %H:%M:%S" | |
print(calc_timeDelta(reference_time='2022-08-10 22:10:49',days=-10,hours=21,minutes=3,time_format=time_format)) |
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
def calc_timeGap(start_time: str, end_time: str, time_format) -> str: | |
time_1 = datetime.strptime(start_time, time_format) | |
time_2 = datetime.strptime(end_time, time_format) | |
time_interval = time_2 - time_1 | |
hour_gap, min_gap = divmod(time_interval.seconds, 3600) | |
time_gap = { | |
"days": time_interval.days, |
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
from datetime import datetime, timedelta | |
def get_kst_Time(): | |
now_time=datetime.now().strftime("%Y-%m-%d %H:%M:%S") | |
# datetime 값으로 변환 | |
utc_time_format=datetime.strptime(now_time,"%Y-%m-%d %H:%M:%S") | |
# KST 시간을 구하기 위해 +9시간 | |
kst_time_format=utc_time_format+timedelta(hours=9) |
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 pyupbit | |
import pandas | |
import numpy | |
ticker =pyupbit.get_tickers() | |
print(ticker) | |
# 과거 데이터 조회 | |
df = pyupbit.get_ohlcv("KRW-BTC",) |
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
# 실시간 데이터처리를 위한 Ring Buffer(고정길이 큐, FixedQueue) 구현 | |
from typing import Any | |
class RingBuffer: | |
class Empty(Exception): | |
''' | |
비어있는 RingBuffer에서 디큐 또는 피크할 떄 내보내는 예외 처리 | |
''' | |
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
#include <iostream> | |
#include <queue> | |
#include <list> | |
#include <vector> | |
#include <algorithm> | |
#include <tuple> | |
#include <cmath> | |
using namespace std; | |
vector<int> conversion(int bit_size, int num_toC){ |
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
#include <iostream> | |
#include <queue> | |
#include <list> | |
#include <vector> | |
#include <algorithm> | |
#include <tuple> | |
using namespace std; | |
tuple<int, vector<int>> tenConvertTwo(int num){ | |
vector<int> temp; |
NewerOlder