import asyncio import timeit from urllib.request import urlopen from concurrent.futures import ThreadPoolExecutor import threading # 실행 시작 시간 start =timeit.default_timer() # 서비스 방향이 비슷한 사이트로 실습권장(예 게시판 성 커뮤니티) urls = ['https://daum.net', 'https://naver.com', 'http://mlbpark.donga.com', 'https://tistory.com'] async def fetch(url, executor): # 실행 res = await loop.get_running_loop(executor, urlopen, url) # 결과 반환 return res.read()[0:5] async def main(): # 쓰레드 풀 생성 executor = ThreadPoolExecutor(max_workers=10) # future 객체 모아서 gather 에서 실행 futures = [ asyncio.ensure_future(fetch(url, executor)) for url in urls ] # 결과 취합 rst = await asyncio.gather(futures) print('------------------------------') print(('Result :', rst)) if __name__ == '__main__': # 루프 초기화 asyncio.run(main()) # 수행 시간 계산 duration = timeit.default_timer() - start # 총 실행 시간 print('Total Running Time :', duration) 여기에서 loop is not defined라고 나오네요 지금 파이선은 3.14버전을 쓰고있는데 저기 loop를 무엇으로 바꾸면 될지 모르겠어요
몽고 DB 접속 중인데요 강의내용 같이 mongodb+srv://admin:qwe123!!@cluster0.ic4ilij.mongodb.net/react_blog?retryWrites=true&w=majority&appName=Cluster0 하고 Connection whit Conection String "Connect"를 누르면 Unable to connect: querySrv ENOTFOUND mongodb. tcp.cluster0.ic4ilij.mongodb.net 라는 메시지와 함께 접속이 안되고 있습니다. 원인과 해결 방안을 여쭤 봅니다. -- 감사합니다.
강사님 답변처럼 SUPABASE_SERVICE_ROLE_KEY 복사하고 붙인 후 실행 했는데도 아래처럼 나오네요. 무시하고 계속 수업 진도를 나갈려고 하는데 내가 워낙 쌩 초보라 13번째 강의에서도 또 언급되길래 계속 무시하고 수업을 끝까지 들으면 해결 할 수 있는지 의심스럽습니다. 그리고 localhost:8000/docs 가 강사님 처럼 열리지 않네요... ㅠㅠ "사이트에 연결할 수 없음. localhost에서 연결을 거부했습니다"라고 하네요 PS C:\박영준\banbu-stocktrading-final> python run.py ⚠ SUPABASE_SERVICE_ROLE_KEY 미설정 - anon 키 사용 중. RLS가 켜져 있으면 쓰기가 차단될 수 있 습니다. Supabase URL: https://fohjixoviclcuwdtadxf.supabase.co INFO: Started server process [23136] INFO: Waiting for application startup. 서비스 시작 시 경제 데이터 수집을 즉시 실행합니다... 경제 지표 및 주가 데이터 업데이트 작업 시작... 2026-07-27 16:39:01,751 - httpx - INFO - HTTP Request: GET https://fohjixoviclcuwdtadxf.supabase.co/rest/v1/economic_and_stock_data?select=%EB%82%A0%EC%A7%9C&order=%EB%82%A0%EC%A7%9C.desc&limit=1 "HTTP/2 403 Forbidden" 마지막 수집 날짜 조회 중 오류 발생: {'message': 'permission denied for table economic_and_stock_data', 'code': '42501', 'hint': 'Grant the required privileges to the current role with: GRANT SELECT ON public.economic_and_stock_data TO service_role;', 'details': None} 2026-07-27 16:39:01,798 - httpx - INFO - HTTP Request: GET https://fohjixoviclcuwdtadxf.supabase.co/rest/v1/economic_and_stock_data?select=%2A&%EB%82%A0%EC%A7%9C=eq.2005-12-31 "HTTP/2 403 Forbidden" 경제 데이터 업데이트 중 오류 발생: {'message': 'permission denied for table economic_and_stock_data', 'code': '42501', 'hint': 'Grant the required privileges to the current role with: GRANT SELECT ON public.economic_and_stock_data TO service_role;', 'details': None} Traceback (most recent call last): File "C:\박영준\banbu-stocktrading-final\app\services\economic_ service.py ", line 134, in update_economic_data_in_background prev_data_response = supabase.table("economic_and_stock_data").select("*").eq("날짜", previous_date).execute() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "C:\Users\박종한\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\postgrest\_sync\request_ builder.py ", line 96, in execute raise APIError(dict(json_obj)) postgrest.exceptions.APIError: {'message': 'permission denied for table economic_and_stock_data', 'code': '42501', 'hint': 'Grant the required privileges to the current role with: GRANT SELECT ON public.economic_and_stock_data TO service_role;', 'details': None} ERROR: Traceback (most recent call last): File "C:\박영준\banbu-stocktrading-final\app\services\economic_ service.py ", line 134, in update_economic_data_in_background prev_data_response = supabase.table("economic_and_stock_data").select("*").eq("날짜", previous_date).execute() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "C:\Users\박종한\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\postgrest\_sync\request_ builder.py ", line 96, in execute raise APIError(dict(json_obj)) postgrest.exceptions.APIError: {'message': 'permission denied for table economic_and_stock_data', 'code': '42501', 'hint': 'Grant the required privileges to the current role with: GRANT SELECT ON public.economic_and_stock_data TO service_role;', 'details': None} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\박종한\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\starlette\ routing.py ", line 638, in lifespan async with self.lifespan_context(app) as maybe_state: ~~~~~~~~~~~~~~~~~~~~~^^^^^ File "C:\Users\박종한\AppData\Local\Python\pythoncore-3.14-64\Lib\ contextlib.py ", line 214, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ async with original_context(app) as maybe_original_state: async with original_context(app) as maybe_original_state: ~~~~~~~~~~~~~~~~^^^^^ async with original_context(app) as maybe_original_state: ~~~~~~~~~~~~~~~~^^^^^ File "C:\Users\박종한\AppData\Local\Python\pythoncore-3.14-64\Lib\ contextlib.py ", line 214, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "C:\박영준\banbu-stocktrading-final\app\ main.py ", line 18, in lifespan await startup() File "C:\박영준\banbu-stocktrading-final\app\ main.py ", line 48, in startup await update_economic_data_in_background() File "C:\박영준\banbu-stocktrading-final\app\services\economic_ service.py ", line 251, in update_economic_data_in_background raise Exception(f"경제 데이터 업데이트 중 오류: {str(e)}") Exception: 경제 데이터 업데이트 중 오류: {'message': 'permission denied for table economic_and_stock_data', 'code': '42501', 'hint': 'Grant the required privileges to the current role with: GRANT SELECT ON public.economic_and_stock_data TO service_role;', 'details': None}
요약 프롬프트의 영문 버전 을 만들 때, 출력 규칙에 포함된 한글 부분은 영어로 번역하지 않고 그대로 유지 하고 싶음 영문 편과 한글 편을 한 번에 함께 출력받고 싶음 그러면 전체 비용도 저렴해지고 쇼츠 생산 속도도 빨라질 것 같아서 이런 방법은 어떨지 생각해보고 가능한지 질문 드리게되었습니다.
1. 현재 학습 진도 섹션 3 15강 수강 2. 어려움을 겪는 부분 아직 섹션3 15강밖에 수강하지 않았지만 예전에 배포했을때 설정 문제로 과금이 나간적이있어서 강의는 계속 들으면서 로컬에서 해보고 개인 프로젝트에 적용해보는것이 좋을까요? 아니면 둘 다 하는것이 좋을까요??
제목 처럼 실행 했을때 아래 사진 처럼 나오네요. 그리고 cursor의 터미널에서 표출된 에러 내용을 복사해서 클로드에 붙여넣기 하는 방법이 ctrl+c, ctrl+v 인가요? 잘 안되어서 질문합니다. 아니면 시간 지체가 있나요? 왜 물어보냐면 노트북을 켜고 커서를 실행하면 시간이 좀 소요되어서 그럽니다. 아직 답변이 없어서 지난 강의를 다시 들으면서 다시 해봐도 같은 결과네요... 강의 내용대로 supabase_key를 복사해 붙였는데도요. 인프런 AI 인턴 답변 처럼 해야 하나요?
for 문에서 초기화 -> 조검검사->참이면 처리->증감->조건검사->조건 감사-> 아닌가요? intc=0; for(I=1; I>3; i++) { c++; } printf("c=%d",c); 정답: ? 답변이 어려운 질문 좋은 질문 예시 3강 12분 35초에서 설명하신 반복문 조건식이 이해되지 않습니다. 왜 i < 10으로 작성하나요? 5강 08분 10초에서 나온 코드 실행 결과가 제 환경에서는 다르게 나옵니다. 아래는 제가 작성한 코드입니다. 정확한 강의 위치와 질문 내용을 함께 남겨주시면 더 빠르고 정확하게 답변드릴 수 있습니다.