목록py (52)
jm_p_op
비동기화 된 함수들은 병렬로 처리가 되지만 안에 인스턴스된 한 객체의 메서드를 사용한다면, 결국 동기화랑 다를것이 없다 객체화된 메서드는 하나임으로 들어온 순서대로 처리 즉 동기화된거랑 차이가 없다 import time import asyncio class T: def __init__(self) -> None: self.x=[] def add(self,n,i): self.x.append(n) time.sleep(1) print("sleep") print(f'{n}명 중 {i}번 째 사용자 조회 중 ...') # async -> 비동기 함수로 변경 import time import asyncio # async -> 비동기 함수로 변경 t=T() async def find_users_async(n): for..
https://github.com/jmpop97/ER_statistics/blob/78bba9e0cfc88b9d3245f557ab11e3d2409aa045/ER_apis/ER_api.py#L213 ERAPI().save_games(start_game: int,n: int = 1,second: int = 1,game_type: list = ["Rank", "Normal", "Cobalt"],duplication=True,reverse=True,d=1, root_dir: str = "") start_game - 게임 데이터 시작 지점 n - 표본의 갯수 game_type - 게임 종류 duplication - 중복 제거 이미 저장된 데이터를 또 받아올 필요가 있을까? → 기본 -True reverse - 역..

넣고 자 하는 영역 클릭후 입력 - 필드 입력 - 필드 이름 입력 - 넣기 () 다 넣으면 다음과 같이 빨간색으로 입력이 된다. hwp.PutFieldText("필드이름","입력값") import sys import os import win32gui import win32com.client as win32 # 현재 파일의 절대 경로 가져오기 #한글 새 문서 가져오기 // HWPFrame.Hwp.Object 말고 pdf도 가능 hwp = win32.gencache.EnsureDispatch('HWPFrame.HwpObject') #윈도우에 열리지 않았으면 0, 열렸으면 해당 번호 출력 if win32gui.FindWindow(None,"빈 문서 1 - 한글") == 0: raise("not open hwp..
import sys import os import win32gui import win32com.client as win32 #한글 새 문서 가져오기 // HWPFrame.Hwp.Object 말고 pdf도 가능 hwp = win32.gencache.EnsureDispatch('HWPFrame.HwpObject') #윈도우에 열리지 않았으면 0, 열렸으면 해당 번호 출력 if win32gui.FindWindow(None,"빈 문서 1 - 한글") == 0: raise("not open hwp") # 한글 프로그램이 보이는 지 설정 ,True : 창이 뜬다 Flase : 백그라운드에서 실행 hwp.XHwpWindows.Item(0).Visible = True # 보안 모듈 실행 뜨지 않도록 하기 ##설정 ht..

https://console.cloud.google.com/apis/dashboard?project Google 클라우드 플랫폼 로그인 Google 클라우드 플랫폼으로 이동 accounts.google.com 프로젝트 생성 생성 후, 이메일 클릭 키만들고 저장. import gspread from oauth2client.service_account import ServiceAccountCredentials scope = [ 'https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive', ] json_file_name = '저장한 파일명' credentials = ServiceAccountCredentials.from_jso..

test1 N=10**8 n=10**4 start= time.time() test1=[time.time()-start for i in range(N)] test1=test1[::n] test2 start= time.time() test1=[] for i in range(N): test1+=[time.time()-start] test1=test1[::n] test3 start= time.time() test1=[] for i in range(N): test1.append(time.time()-start) test1=test1[::n] test4 start= time.time() test1=[None]*N for i in range(N): test1[i]=time.time()-start test1=test1..
conditions에 해당되는 list추출 conditions에서 간단한 산수 추가 => 이름이 길어짐 => 이름 변경필요 => kwargs사용 kwargs값의 key값이 string 값으로 넣어줄수가 없다(*,+등등 사칙연산을 변수명으로 쓸수없음)=>unpacking으로 집어 넣기 class ListFilterData(DataClass): def __init__(self, *conditions, **name_dic): """1.must name_dic.value not in conditions 2. only */+-() """ self.name_dic = name_dic self.conditions = {} for condition in conditions: self.conditions[name_dic..
class FigureType: def __init__(self): self.plt def barplot(self,**conditions2): conditions3=conditions2 sns.barplot(**conditions3) test=FigureType() conditions1={db="1",x="2",y="3"} test.barplot(**conditions1) 함수를 쓸때 kwargs을 하나 하나 지정한다면, kwarg 하나 추가할때마다, 함수를 바꿔줘야한다. condition1 => 언팩킹으로 데이터 풀기 condition2 => 팩킹으로 묶기 condition3 => 언팩킹으로 원래 실행하는곳에 풀어주기