asistencias.py
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 15/100
Hướng nghiên cứu
The pasted file is a Python attendance-control script, not code from this JavaScript/TypeScript repository, and the issue does not say what to change. The visible defects are a stray backtick in registrar_empleado (printi/n¨...), a backtick before from datetime import datetime at the top, and the label sALIDA in mostrar_registro. Confirm with the author what is wanted before editing, then run the script with python asistencias.py to check that it starts.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
from datetime import datetime
===================== CLASE EMPLEADO =====================
class Empleado:
def init(self, numero, nombre, puesto):
self.numero = numero
self.nombre = nombre
self.puesto = puesto
self.entrada = None
self.salida = None
def registrar_entrada(self):
if self.entrada is None:
self.entrada = datetime.now()
print(f"\nEntrada registrada para: {self.nombre}")
print(f"Hora: {self.entrada.strftime('%d/%m/%Y %H:%M:%S')}")
else:
print(f"\n {self.nombre} ya tiene una entrada registrada.")
def registrar_salida(self):
if self.entrada is None:
print(f"\n {self.nombre} no tiene entrada registrada.")
elif self.salida is None:
self.salida = datetime.now()
print(f"\nSalida registrada para: {self.nombre}")
print(f"🕐 Hora: {self.salida.strftime('%d/%m/%Y %H:%M:%S')}")
else:
print(f"\n {self.nombre} ya tiene una salida registrada.")
def mostrar_registro(self):
print("\n" + "-" * 40)
print(f"NÚMERO: {self.numero}")
print(f"NOMBRE: {self.nombre}")
print(f"PUESTO: {self.puesto}")
if self.entrada:
print(f"ENTRADA: {self.entrada.strftime('%d/%m/%Y %H:%M:%S')}")
else:
print(f"ENTRADA: Sin registro")
if self.salida:
print(f"SALIDA: {self.salida.strftime('%d/%m/%Y %H:%M:%S')}")
else:
print(f"sALIDA: Sin registro")
print("-" * 40)
===================== CLASE CONTROL DE ASISTENCIA =====================
class ControlAsistencia:
def init(self):
self.empleados = {}
def registrar_empleado(self):
print("\n" + "=" * 40)
print(" REGISTRAR EMPLEADO")
print("=" * 40)
numero = input("Número de empleado: ")
if numero in self.empleados:
`printi/n¨El empleado ya está registrado.")
return
nombre = input("👤 Nombre completo: ")
puesto = input("💼 Puesto: ")
self.empleados[numero] = Empleado(numero, nombre, puesto)
print("✅ Empleado registrado correctamente.")
def buscar_empleado(self):
print("\n" + "=" * 40)
numero = input("🔢 Número de empleado: ")
if numero in self.empleados:
return self.empleados[numero]
print("❌ Empleado no encontrado.")
return None
def registrar_entrada(self):
print("\n" + "=" * 40)
print(" REGISTRAR ENTRADA")
print("=" * 40)
empleado = self.buscar_empleado()
if empleado:
empleado.registrar_entrada()
def registrar_salida(self):
print("\n" + "=" * 40)
print(" REGISTRAR SALIDA")
print("=" * 40)
empleado = self.buscar_empleado()
if empleado:
empleado.registrar_salida()
def mostrar_registros(self):
print("\n" + "=" * 40)
print(" LISTA DE REGISTROS")
print("=" * 40)
if not self.empleados:
print("📭 No hay empleados registrados.")
return
for empleado in self.empleados.values():
empleado.mostrar_registro()
===================== PROGRAMA PRINCIPAL =====================
def main():
sistema = ControlAsistencia()
while True:
print("\n" + "=" * 40)
print(" SISTEMA DE CONTROL DE ASISTENCIA")
print("=" * 40)
print(" 1 → Registrar empleado")
print(" 2 → Registrar entrada")
print(" 3 → Registrar salida")
print(" 4 → Mostrar todos los registros")
print(" 5 → Salir del sistema")
print("=" * 40)
opcion = input("👉 Elige una opción: ")
if opcion == "1":
sistema.registrar_empleado()
elif opcion == "2":
sistema.registrar_entrada()
elif opcion == "3":
sistema.registrar_salida()
elif opcion == "4":
sistema.mostrar_registros()
elif opcion == "5":
print("\n👋 Sistema finalizado. ¡Hasta luego!")
break
else:
print("\n❌ Opción no válida. Intenta nuevamente.")
Ejecutar el programa
if name == "main":
main()
- Ngôn ngữ chính
- TypeScript
- Star
- 104
- Fork
- 36
- Merge trung bình
- 4 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của serpapi/serpapi-javascript
-
Default client timeout (60s) is shorter than the server-side timeout (90s)Có thể đã có người làm @Babyy-dev đã nhận 6 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Deno deprecationCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
serpapi/serpapi-javascript#55 · 2 bình luận ·
-
Timeout issuesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
types are extremely poor without coverage.Có thể đã có người làm @nya-a-cat đã nhận 151 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
serpapi/serpapi-javascript#33 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Tất cả issue của serpapi/serpapi-javascript
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
superlinked/sie#1033 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
remix-run/react-router#15838 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/ci bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
melgarafael/DeskcommCRM#5290 ·
Maintainer thường phản hồi trong vòng 1 ngày