Update Python Ofensivo

This commit is contained in:
Manuel Vergara 2023-12-29 07:05:48 +01:00
parent 159d9490a4
commit d49859c627
7 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Tan solo es un paquete de prueba
Esto sería la descripción del paquete
## Listas cursos
- "Introducción a Linux" 15 horas
- "Introducción a Python" 25 horas
- "Django en profundidad" 55 horas
- "Personalización de Linux" 45 horas
## Instalación
Para instalar el paquete tan solo hay que ejecutar:
```bash
pip install paquete
```
## Uso
```python
import paquete
paquete.saludar()
```
## Créditos
- [Manuel](https://www.youtube.com/manuel)

View File

@ -0,0 +1,2 @@
from .courses import *
from .utils import *

View File

@ -0,0 +1,37 @@
class Course:
def __init__(self, id, name, duration, link):
self.id = id
self.name = name
self.duration = duration
self.link = link
def __repr__(self):
return f"""[i] {self.id} {self.name}
- Duration: {self.duration} horas
- Link: {self.link}
"""
courses = [
Course(1, "Introducción a Linux", 15, "https://www.python.org/"),
Course(2, "Introducción a Python", 25, "https://www.python.org/"),
Course(3, "Django en profundidad", 55, "https://www.python.org/"),
Course(4, "Personalización de Linux", 45, "https://www.python.org/"),
]
def list_courses():
for course in courses:
print(course)
def search_course_by_name(name):
for course in courses:
if course.name == name:
return course
break
else:
print("No se encontró ningún curso")

View File

@ -0,0 +1,5 @@
from .courses import courses
def total_duration():
return sum(course.duration for course in courses)

View File

@ -0,0 +1,16 @@
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name='paquete_ejemplo',
version='0.1.0',
packages=find_packages(),
install_requires=[],
author='Manuel Vergara',
description='Paquete de ejemplo',
long_description=long_description,
long_description_content_type="text/markdown",
url="https://vergaracarmona.es",
)