aliceblue11 commited on
Commit
651e52d
·
verified ·
1 Parent(s): ed7a2c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -173,6 +173,9 @@ def calculate_saju(birth_date, birth_time, gender, birth_place):
173
  if not birth_date:
174
  return "❌ 생년월일을 입력해주세요."
175
 
 
 
 
176
  # 유연한 날짜 파싱
177
  try:
178
  year, month, day = parse_flexible_date(birth_date)
@@ -201,8 +204,6 @@ def calculate_saju(birth_date, birth_time, gender, birth_place):
201
  except ValueError as e:
202
  return f"❌ 유효하지 않은 날짜입니다: {year}년 {month}월 {day}일\n{str(e)}"
203
 
204
- calculator = SajuCalculator()
205
-
206
  # 간지 계산
207
  ganzhi = calculator.get_ganzhi(
208
  birth_datetime.year,
 
173
  if not birth_date:
174
  return "❌ 생년월일을 입력해주세요."
175
 
176
+ # SajuCalculator 인스턴스 생성 (맨 앞에서 생성)
177
+ calculator = SajuCalculator()
178
+
179
  # 유연한 날짜 파싱
180
  try:
181
  year, month, day = parse_flexible_date(birth_date)
 
204
  except ValueError as e:
205
  return f"❌ 유효하지 않은 날짜입니다: {year}년 {month}월 {day}일\n{str(e)}"
206
 
 
 
207
  # 간지 계산
208
  ganzhi = calculator.get_ganzhi(
209
  birth_datetime.year,