Skip to content

import threading -> textual 이용 채팅 만들기 #128

Description

@ppabam

참고

시작코드

import threading
import time

def print_auto():
    # TODO - 카프카 소비자
    while True:
        print("[자동 메시지] 안녕하세요! (5초마다 출력)")
        time.sleep(5)

def main():
    # 백그라운드 쓰레드 시작
    thread = threading.Thread(target=print_auto, daemon=True)
    thread.start()

    # TODO - 카프카 생산자
    # 메인 쓰레드는 사용자 입력 받기
    while True:
        user_input = input(">>> ")
        if user_input.lower() == 'exit':
            print("프로그램 종료")
            break
        else:
            print(f"[입력 받음] {user_input}")

if __name__ == "__main__":
    main()

제출

  • 브랜치 -> 0.3/threading, 0.4/textual 로 작업 진행 및 각각 PR 제출
  • 두명이 대화한 내용을 스크릿샷으로 남겨주세요 ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions