# 📝알바 후기/추천

# 아르바이트의 후기 또는 추천 리스트를 아래의 링크를 타고 들어가 적어주세요!

## 실제 근무한 학생들의 솔직한 후기와 추천 알바를 공유합니다.
좋은 알바를 찾고 싶은 분들에게 유용한 정보가 가득해요.

```
import ipywidgets as widgets
from IPython.display import display, clear_output
import datetime
from google.colab import drive

# Google Drive 마운트
drive.mount('/content/drive')

# 저장 경로 설정
save_path = '/content/drive/MyDrive/alba_board.txt'

# 저장된 게시글 불러오기
def load_posts():
    try:
        with open(save_path, 'r', encoding='utf-8') as f:
            posts = f.readlines()
        return posts
    except FileNotFoundError:
        return []

# 게시글 저장 함수
def save_post(title, content):
    time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
    with open(save_path, 'a', encoding='utf-8') as f:
        f.write(f"{time} | {title} | {content}\n")

# 글 목록 출력 함수
def show_posts(b):
    output.clear_output()
    posts = load_posts()
    if not posts:
        with output:
            print("\n❌ 등록된 글이 없습니다.\n")
    else:
        with output:
            print("\n📋 등록된 알바 글 목록:\n")
            for p in posts:
                print(p)

# 글 등록 함수
def add_post(b):
    title = title_text.value
    content = content_text.value
    save_post(title, content)
    output.clear_output()
    with output:
        print("\n✅ 글이 저장되었습니다.\n")
    title_text.value = ""
    content_text.value = ""

# 종료 함수
def exit_program(b):
    output.clear_output()
    with output:
        print("\n👋 프로그램을 종료합니다.\n")

# UI 구성
title_text = widgets.Text(placeholder="제목을 입력하세요")
content_text = widgets.Textarea(placeholder="내용을 입력하세요", layout=widgets.Layout(width='400px', height='100px'))
add_button = widgets.Button(description="글 등록")
view_button = widgets.Button(description="글 불러오기")
exit_button = widgets.Button(description="프로그램 종료")
output = widgets.Output()

# 버튼과 함수 연결
add_button.on_click(add_post)
view_button.on_click(show_posts)
exit_button.on_click(exit_program)

# 인터페이스 출력
display(title_text, content_text, add_button, view_button, exit_button, output)

```

[![웹페이지에서 실행하기](https://upload.cafenono.com/image/slashpageHome/20250515/165713_fogaAm2dXz8xbkOcFb?q=80&s=1280x180&t=outside&f=webp)](https://colab.research.google.com/drive/1e2xaO6r2KbBQSptrf6UJcVJ-qjFfDfWL#scrollTo=uXz8PF8JVkL-)

[https://slashpage.com/work-play/5r398nmnr7y16mvwje7y](https://slashpage.com/work-play/5r398nmnr7y16mvwje7y)

For the site tree, see the [root Markdown](https://slashpage.com/work-play.md).
