Programing/Python
-
[slack_bolt] app.event 또는 app.action에서 reply 하기Programing/Python 2024. 4. 15. 13:29
Reply 로 메세지를 생성하기 위해서는 아래와 같이 thread_ts 를 say로 전달해 주면 된다. app.event @app.event("message") def handle_message_events(body, event, say): say({ "channel": body["event"]["channel"], "text": "This is a threaded reply!", "thread_ts": body.get("thread_ts", body["event"]["ts"]), # Use thread_ts if available, otherwise use ts }) app.action @app.action("action_id") def button_click(ack, body, say): # Ackn..
-
주식 정보 크롤링 및 필터링Programing/Python 2023. 3. 3. 15:05
아래 코드는 나도코딩님의 유투브 강좌를 참고하였다. 웹사이트로 부터 크롤링을 통해 데이터를 긁어온 후 데이터를 조건에 맞게 Filtering 을 적용해 보았다. https://youtu.be/ZDh1C7qw0Rs 예제에서는 총 3가지 필드, '영업이익', '자산총계', '매출액' 를 읽어오지만, 나는 ['거래량', '외국인비율', 'PER', 'ROE', 'ROA', 'PBR'] 를 읽어 왔다. [크롤링코드] ## pip install pandas, selenium, lxml import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By import os browser = webdriver.Chro..
-
[Warning] Thread issue (OMP_NUM_THREADS=1)Programing/Python 2023. 3. 2. 11:26
문제점: KMeans is known to have a memory leak on .... You can avoid it by setting the environment variable OMP_NUM_THREADS=1 해결책: 아래 환경 옵션 추가. 단, 해당 옵션은 numpy 패키지를 import 하지 전에 적용되어야만 함 import os os.environ['OMP_NUM_THREADS'] = '1'
-
-
[VSCode] pandas is not installedPrograming/Python 2021. 8. 25. 09:04
윈도우 시스템에서 pip 를 이용해 요구되는 해당 패키지를 설치하였음에도 VSCode 에서 작성한 파이썬 코드를 실행시키면 패키지를 발견하지 못한다는 에러메세지를 만나게 되었습니다. [해결책] 파이썬 패키지를 설치할때 설치할 디렉토리 위치를 --target 옵션을 통해 수동으로 지정할 수 있습니다. $> pip3 install --target="$PYTHONPATH" pandas 파이썬 코드 내에서 참조하고 있는 pythonpath는 다음과 같이 확인할 수 있습니다. import sys print (sys.path)