{"id":1552,"date":"2024-11-19T20:55:50","date_gmt":"2024-11-19T23:55:50","guid":{"rendered":"https:\/\/martafagundez.com\/codevolution\/?p=1552"},"modified":"2024-12-01T18:19:56","modified_gmt":"2024-12-01T21:19:56","slug":"setup-basico-para-proyectos-de-python","status":"publish","type":"post","link":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/","title":{"rendered":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes"},"content":{"rendered":"\n<p>Iniciar un proyecto en <strong>Python<\/strong> puede parecer sencillo, pero establecer una base s\u00f3lida desde el principio es esencial para garantizar que tu c\u00f3digo sea <strong>organizado, escalable y f\u00e1cil de mantener<\/strong>. En este art\u00edculo, aprender\u00e1s los pasos clave para configurar un entorno de desarrollo b\u00e1sico en Python que podr\u00e1s utilizar como punto de partida para futuros proyectos m\u00e1s complejos.<\/p>\n\n\n\n<p>Este setup es ideal para proyectos que integren frameworks como <strong>Flask<\/strong>, herramientas como <strong><a href=\"https:\/\/martafagundez.com\/codevolution\/que-es-sqlalchemy-y-como-puede-simplificar-tu-trabajo-con-bases-de-datos\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQLAlchemy<\/a><\/strong> o cualquier librer\u00eda que planees explorar.<\/p>\n\n\n\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"simpletoc-title\">Tabla de contenidos<\/h2>\n<style>html { scroll-behavior: smooth; }<\/style><ul class=\"simpletoc-list\">\n<li><a href=\"#1-instala-python-y-configura-tu-entorno\">1. Instala Python y Configura tu Entorno<\/a>\n\n\n<ul><li>\n<a href=\"#11-descarga-e-instala-python\">1.1 Descarga e instala Python<\/a>\n\n<\/li>\n<li><a href=\"#12-verifica-la-instalacion\">1.2 Verifica la instalaci\u00f3n<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#2-configura-un-entorno-virtual\">2. Configura un Entorno Virtual<\/a>\n\n\n<ul><li>\n<a href=\"#21-crear-un-entorno-virtual\">2.1 Crear un entorno virtual<\/a>\n\n<\/li>\n<li><a href=\"#22-activar-el-entorno-virtual\">2.2 Activar el entorno virtual<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#3-configura-un-archivo-requirementstxt\">3. Configura un Archivo requirements.txt<\/a>\n\n\n<ul><li>\n<a href=\"#31-instala-una-libreria-como-ejemplo\">3.1 Instala una librer\u00eda como ejemplo<\/a>\n\n<\/li>\n<li><a href=\"#32-crea-el-archivo-requirementstxt\">3.2 Crea el archivo requirements.txt<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#4-organiza-tu-proyecto-con-una-estructura-basica\">4. Organiza tu Proyecto con una Estructura B\u00e1sica<\/a>\n\n\n<ul><li>\n<a href=\"#41-archivo-gitignore\">4.1 Archivo .gitignore<\/a>\n\n<\/li>\n<li><a href=\"#42-archivo-initpy\">4.2 Archivo __init__.py<\/a>\n\n\n<\/li>\n\n<\/li>\n\n<\/li>\n<\/ul>\n<li><a href=\"#5-configura-un-sistema-de-control-de-versiones-git\">5. Configura un Sistema de Control de Versiones (Git)<\/a>\n\n\n<ul><li>\n<a href=\"#51-inicializa-un-repositorio\">5.1 Inicializa un repositorio<\/a>\n\n<\/li>\n<li><a href=\"#52-realiza-tu-primer-commit\">5.2 Realiza tu primer commit<\/a>\n\n<\/li>\n<\/ul>\n<li><a href=\"#6-prueba-tu-configuracion-con-un-codigo-simple\">6. Prueba tu Configuraci\u00f3n con un C\u00f3digo Simple<\/a>\n\n<\/li>\n<li><a href=\"#conclusion\">Conclusi\u00f3n<\/a>\n<\/li><\/ul>\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"1-instala-python-y-configura-tu-entorno\"><strong>1. Instala Python y Configura tu Entorno<\/strong><\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"11-descarga-e-instala-python\"><strong>1.1 Descarga e instala Python<\/strong><\/h3>\n\n\n<ul class=\"wp-block-list\">\n<li>Ve al sitio oficial de <a href=\"https:\/\/www.python.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a> y descarga la \u00faltima versi\u00f3n estable.<\/li>\n\n\n\n<li>Durante la instalaci\u00f3n, aseg\u00farate de marcar la opci\u00f3n <strong>\u00abAdd Python to PATH\u00bb<\/strong> para que puedas ejecutar Python desde la terminal.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"12-verifica-la-instalacion\"><strong>1.2 Verifica la instalaci\u00f3n<\/strong><\/h3>\n\n\n<p>Abre tu terminal y escribe:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"python --version\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">python<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #CB4B16\">--version<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Esto mostrar\u00e1 la versi\u00f3n instalada. Si no aparece, revisa que Python est\u00e9 correctamente agregado al PATH.<\/p>\n\n\n\n<p>Puedes encontrar informaci\u00f3n m\u00e1s detallada respecto a la instalaci\u00f3n de Python en mi art\u00edculo <a href=\"https:\/\/martafagundez.com\/codevolution\/como-instalar-python-en-windows-11\/\" target=\"_blank\" rel=\"noreferrer noopener\">C\u00f3mo Instalar Python en Windows 11<\/a>.<\/p>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"2-configura-un-entorno-virtual\"><strong>2. Configura un Entorno Virtual<\/strong><\/h2>\n\n\n<p>Los entornos virtuales son esenciales para<strong> aislar las dependencias de cada proyecto<\/strong> y evitar conflictos con otras aplicaciones en tu m\u00e1quina.<\/p>\n\n\n\n<p>Es decir, <strong>si necesitas instalar dependencias en tu proyecto<\/strong>, necesitas crear un entorno virtual previamente.<\/p>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"21-crear-un-entorno-virtual\"><strong>2.1 Crear un entorno virtual<\/strong><\/h3>\n\n\n<p>En la terminal, navega a la carpeta ra\u00edz de tu proyecto y ejecuta:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"python -m venv venv\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">python<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #CB4B16\">-m<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">venv<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">venv<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Este comando crear\u00e1 un directorio llamado <strong>venv<\/strong> en la carpeta ra\u00edz de tu proyecto. Dicho directorio tendr\u00e1 esta estructura:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"230\" height=\"134\" src=\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\" loading=\"lazy\" alt=\"\" class=\"wp-image-1562\"\/><\/figure>\n\n\n\n<div style=\"height:24px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"22-activar-el-entorno-virtual\"><strong>2.2 Activar el entorno virtual<\/strong><\/h3>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Windows<\/strong> mediante <strong>cmd<\/strong>:<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"venv\\Scripts\\activate\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">venv\\Scripts\\activate<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Windows<\/strong> mediante <strong>git bash<\/strong>:<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"source venv\/Scripts\/activate\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">source<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">venv\/Scripts\/activate<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>macOS\/Linux<\/strong>:<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"source venv\/bin\/activate\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">source<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">venv\/bin\/activate<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Cuando el entorno est\u00e9 activado, deber\u00edas ver algo como <code>(venv)<\/code> al inicio de tu l\u00ednea de comandos:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"101\" src=\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/entorno_activado_setup_base_proyecto_python.png\" loading=\"lazy\" alt=\"\" class=\"wp-image-1569\" srcset=\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/entorno_activado_setup_base_proyecto_python.png 614w, https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/entorno_activado_setup_base_proyecto_python-300x49.png 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/figure>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"3-configura-un-archivo-requirementstxt\"><strong>3. Configura un Archivo <code>requirements.txt<\/code><\/strong><\/h2>\n\n\n<p>Este archivo permite especificar las dependencias del proyecto, facilitando la instalaci\u00f3n de librer\u00edas en otros entornos o para otros desarrolladores.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"31-instala-una-libreria-como-ejemplo\"><strong>3.1 Instala una librer\u00eda como ejemplo<\/strong><\/h3>\n\n\n<p>Instala una librer\u00eda com\u00fan, como <code>requests<\/code>, con el siguiente comando:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"pip install requests\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">pip<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">install<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">requests<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"32-crea-el-archivo-requirementstxt\"><strong>3.2 Crea el archivo <code>requirements.txt<\/code><\/strong><\/h3>\n\n\n<p>Guarda las dependencias instaladas con:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"pip freeze &gt; requirements.txt\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">pip<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">freeze<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">&gt;<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">requirements.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>El archivo generado incluir\u00e1 algo como:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">requirements.txt<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"requests==2.32.3\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #f6f6f4\">requests==2.32.3<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Plaintext<\/span><\/div>\n\n\n\n<p>En proyectos futuros, otros desarrolladores podr\u00e1n instalar estas dependencias con:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"pip install -r requirements.txt\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">pip<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">install<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #CB4B16\">-r<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">requirements.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"4-organiza-tu-proyecto-con-una-estructura-basica\"><strong>4. Organiza tu Proyecto con una Estructura B\u00e1sica<\/strong><\/h2>\n\n\n<p>La organizaci\u00f3n del c\u00f3digo es clave para mantenerlo legible y escalable. Aqu\u00ed tienes una posible estructura inicial:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #24292e\">mi_proyecto\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u2502<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u251c\u2500\u2500 venv\/               # Entorno virtual<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u251c\u2500\u2500 requirements.txt    # Dependencias del proyecto<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u251c\u2500\u2500 .gitignore          # Archivos a excluir del control de versiones<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u251c\u2500\u2500 main.py             # Archivo principal<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">\u2514\u2500\u2500 src\/                # C\u00f3digo fuente<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">    \u251c\u2500\u2500 __init__.py     # Inicializaci\u00f3n del paquete<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292e\">    \u2514\u2500\u2500 utils.py        # Funciones auxiliares<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"41-archivo-gitignore\"><strong>4.1 Archivo <code>.gitignore<\/code><\/strong><\/h3>\n\n\n<p>Si usas Git, incluye un archivo <code>.gitignore<\/code> en tu directorio ra\u00edz para evitar subir archivos innecesarios al repositorio. Por ejemplo:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">.gitignore<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"venv\/\n__pycache__\/\n*.pyc\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #f6f6f4\">venv\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #f6f6f4\">__pycache__\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #f6f6f4\">*.pyc<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Plaintext<\/span><\/div>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"42-archivo-initpy\"><strong>4.2 Archivo <code>__init__.py<\/code><\/strong><\/h3>\n\n\n<p>En la carpeta ra\u00edz, crea una nueva carpeta llamada <strong>src<\/strong> y dentro de ella crea el archivo <code>__init__.py <\/code>.<\/p>\n\n\n\n<p>Este archivo es una parte esencial de cualquier paquete en Python. Aunque a menudo est\u00e1 vac\u00edo, le indica a Python que la carpeta donde se encuentra debe ser tratada como un <strong>paquete<\/strong>.<\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"421-para-que-sirve\"><strong>4.2.1 \u00bfPara qu\u00e9 sirve?<\/strong><\/h4>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Definir paquetes<\/strong>: Permite organizar y agrupar m\u00f3dulos en una estructura jer\u00e1rquica.<\/li>\n\n\n\n<li><strong>Inicializaci\u00f3n personalizada<\/strong>: Puedes incluir c\u00f3digo que se ejecute al importar el paquete, como configuraciones globales o importaciones comunes.<\/li>\n<\/ul>\n\n\n<h4 class=\"wp-block-heading\" id=\"422-como-se-usa\"><strong>4.2.2 \u00bfC\u00f3mo se usa?<\/strong><\/h4>\n\n\n<p>En proyectos simples, este archivo puede estar vac\u00edo, como:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">__init__.py<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# __init__.py vac\u00edo\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #7B7F8B\"># __init__.py vac\u00edo<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p>En proyectos m\u00e1s complejos, puedes usarlo para exponer funciones o clases espec\u00edficas al importar el paquete:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">__init__.py<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"# __init__.py con contenido\nfrom .utils import greet\n\n__all__ = [&quot;greet&quot;]\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #7B7F8B\"># __init__.py con contenido<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">from<\/span><span style=\"color: #F6F6F4\"> .utils <\/span><span style=\"color: #F286C4\">import<\/span><span style=\"color: #F6F6F4\"> greet<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #BF9EEE\">__all__<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> [<\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #E7EE98\">greet<\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #F6F6F4\">]<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p>Con esto, al importar el paquete (<code>from src import *<\/code>), solo las funciones definidas en <code>__all__<\/code> estar\u00e1n disponibles.<\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"423-es-obligatorio\"><strong>4.2.3 \u00bfEs obligatorio?<\/strong><\/h4>\n\n\n<p>Desde Python 3.3, el archivo <code>__init__.py<\/code> no es estrictamente necesario para definir paquetes, pero incluirlo sigue siendo una buena pr\u00e1ctica para mantener compatibilidad y claridad en la estructura del proyecto.<\/p>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"5-configura-un-sistema-de-control-de-versiones-git\"><strong>5. Configura un Sistema de Control de Versiones (Git)<\/strong><\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"51-inicializa-un-repositorio\"><strong>5.1 Inicializa un repositorio<\/strong><\/h3>\n\n\n<p>Desde la carpeta ra\u00edz del proyecto, ejecuta:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"git init\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">git<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">init<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"52-realiza-tu-primer-commit\"><strong>5.2 Realiza tu primer commit<\/strong><\/h3>\n\n\n<ol class=\"wp-block-list\">\n<li>Agrega tus archivos al repositorio:<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"git add .\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">git<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">add<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">.<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Crea un commit:<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"git commit -m &quot;Configuraci\u00f3n inicial del proyecto&quot;\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">git<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">commit<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #CB4B16\">-m<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">&quot;Configuraci\u00f3n inicial del proyecto&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:80px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"6-prueba-tu-configuracion-con-un-codigo-simple\"><strong>6. Prueba tu Configuraci\u00f3n con un C\u00f3digo Simple<\/strong><\/h2>\n\n\n<p>En la carpeta ra\u00edz crea un archivo <code>main.py<\/code> con este c\u00f3digo:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">main.py<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"from src.utils import greet\n\nif __name__ == &quot;__main__&quot;:\n    greet(&quot;Mundo&quot;)\n\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F286C4\">from<\/span><span style=\"color: #F6F6F4\"> src.utils <\/span><span style=\"color: #F286C4\">import<\/span><span style=\"color: #F6F6F4\"> greet<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">if<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">__name__<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">==<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #E7EE98\">__main__<\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #F6F6F4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    greet(<\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #E7EE98\">Mundo<\/span><span style=\"color: #DEE492\">&quot;<\/span><span style=\"color: #F6F6F4\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p>Y en el directorio <strong>src<\/strong> crea un archivo <code>utils.py<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#f6f6f4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#282A36;font-style:italic;color:#f6f6f4\"><span style=\"border-bottom:1px solid rgba(251, 251, 239, 0.2)\">utils.py<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"def greet(name):\n    print(f&quot;Hola, {name}!&quot;)\n\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F286C4\">def<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">greet<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #FFB86C; font-style: italic\">name<\/span><span style=\"color: #F6F6F4\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #97E1F1\">print<\/span><span style=\"color: #F6F6F4\">(<\/span><span style=\"color: #F286C4\">f<\/span><span style=\"color: #E7EE98\">&quot;Hola, <\/span><span style=\"color: #BF9EEE\">{<\/span><span style=\"color: #F6F6F4\">name<\/span><span style=\"color: #BF9EEE\">}<\/span><span style=\"color: #E7EE98\">!&quot;<\/span><span style=\"color: #F6F6F4\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#282A36;color:#ebebe6;font-size:12px;line-height:1;position:relative\">Python<\/span><\/div>\n\n\n\n<p>Ejecuta el proyecto:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 0 16px;font-size:0.8em;width:100%;text-align:left;background-color:#FDF6E3;font-style:italic;color:#657B83\"><span style=\"border-bottom:1px solid rgba(43, 150, 189, 0.2)\">Bash<\/span><\/span><span role=\"button\" tabindex=\"0\" data-code=\"python main.py\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #268BD2\">python<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #2AA198\">main.py<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div style=\"height:32px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusi\u00f3n<\/strong><\/h2>\n\n\n<p>Este setup b\u00e1sico para proyectos de Python te permitir\u00e1 construir con una <strong>base s\u00f3lida y buenas pr\u00e1cticas<\/strong> desde el principio. A medida que explores frameworks como Flask o herramientas como SQLAlchemy, esta estructura facilitar\u00e1 su integraci\u00f3n.<\/p>\n\n\n\n<p>Si est\u00e1s listo para dar el siguiente paso, est\u00e1 atento a mis pr\u00f3ximos art\u00edculos donde explicar\u00e9 c\u00f3mo implementar <strong>Flask <\/strong>y configurar bases de datos con <a href=\"https:\/\/martafagundez.com\/codevolution\/que-es-sqlalchemy-y-como-puede-simplificar-tu-trabajo-con-bases-de-datos\" target=\"_blank\" rel=\"noreferrer noopener\">SQLAlchemy<\/a>. \u00a1El \u00e9xito de tus proyectos comienza con una buena preparaci\u00f3n!<\/p>\n\n\n\n<p>\u00bfTienes alguna sugerencia o duda? \u00a1D\u00e9jala en los comentarios!\ud83d\udc69\u200d\ud83d\udcbb<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Iniciar un proyecto en Python puede parecer sencillo, pero establecer una base s\u00f3lida desde el principio es esencial para garantizar que tu c\u00f3digo sea organizado,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[39,42,52],"tags":[35],"class_list":["post-1552","post","type-post","status-publish","format-standard","hentry","category-backend","category-desarrollo-web","category-python","tag-back-end"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution<\/title>\n<meta name=\"description\" content=\"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution\" \/>\n<meta property=\"og:description\" content=\"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\" \/>\n<meta property=\"og:site_name\" content=\"CODEvolution\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-19T23:55:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-01T21:19:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"230\" \/>\n\t<meta property=\"og:image:height\" content=\"134\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Marta Fag\u00fandez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marta Fag\u00fandez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\"},\"author\":{\"name\":\"Marta Fag\u00fandez\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1\"},\"headline\":\"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes\",\"datePublished\":\"2024-11-19T23:55:50+00:00\",\"dateModified\":\"2024-12-01T21:19:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\"},\"wordCount\":768,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1\"},\"image\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\",\"keywords\":[\"Back End\"],\"articleSection\":[\"Back End\",\"Desarrollo Web\",\"Python\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\",\"url\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\",\"name\":\"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution\",\"isPartOf\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\",\"datePublished\":\"2024-11-19T23:55:50+00:00\",\"dateModified\":\"2024-12-01T21:19:56+00:00\",\"description\":\"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.\",\"breadcrumb\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage\",\"url\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\",\"contentUrl\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png\",\"width\":230,\"height\":134},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/martafagundez.com\/codevolution\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#website\",\"url\":\"https:\/\/martafagundez.com\/codevolution\/\",\"name\":\"CODEvolution\",\"description\":\"Blog de Marta Fag\u00fandez\",\"publisher\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/martafagundez.com\/codevolution\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1\",\"name\":\"Marta Fag\u00fandez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2023\/08\/marta_fagundez_developer_avatar1.png\",\"contentUrl\":\"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2023\/08\/marta_fagundez_developer_avatar1.png\",\"width\":603,\"height\":603,\"caption\":\"Marta Fag\u00fandez\"},\"logo\":{\"@id\":\"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/image\/\"},\"description\":\"Aqu\u00ed comparto algunos de mis aprendizajes como desarrolladora web. Si alguno de mis art\u00edculos te ha resultado \u00fatil, me alegrar\u00eda saberlo ;)\",\"sameAs\":[\"https:\/\/martafagundez.com\",\"https:\/\/www.linkedin.com\/in\/martafagundezrodriguez\",\"https:\/\/www.youtube.com\/@martafagundez\"],\"url\":\"https:\/\/martafagundez.com\/codevolution\/author\/marta\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution","description":"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/","og_locale":"es_ES","og_type":"article","og_title":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution","og_description":"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.","og_url":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/","og_site_name":"CODEvolution","article_published_time":"2024-11-19T23:55:50+00:00","article_modified_time":"2024-12-01T21:19:56+00:00","og_image":[{"width":230,"height":134,"url":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png","type":"image\/png"}],"author":"Marta Fag\u00fandez","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Marta Fag\u00fandez","Tiempo de lectura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#article","isPartOf":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/"},"author":{"name":"Marta Fag\u00fandez","@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1"},"headline":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes","datePublished":"2024-11-19T23:55:50+00:00","dateModified":"2024-12-01T21:19:56+00:00","mainEntityOfPage":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/"},"wordCount":768,"commentCount":0,"publisher":{"@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1"},"image":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage"},"thumbnailUrl":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png","keywords":["Back End"],"articleSection":["Back End","Desarrollo Web","Python"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/","url":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/","name":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes - CODEvolution","isPartOf":{"@id":"https:\/\/martafagundez.com\/codevolution\/#website"},"primaryImageOfPage":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage"},"image":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage"},"thumbnailUrl":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png","datePublished":"2024-11-19T23:55:50+00:00","dateModified":"2024-12-01T21:19:56+00:00","description":"Aprende a configurar un proyecto b\u00e1sico en Python con buenas pr\u00e1cticas. Descubre c\u00f3mo usar entornos virtuales, gestionar dependencias, etc.","breadcrumb":{"@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#primaryimage","url":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png","contentUrl":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2024\/11\/image-1.png","width":230,"height":134},{"@type":"BreadcrumbList","@id":"https:\/\/martafagundez.com\/codevolution\/setup-basico-para-proyectos-de-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/martafagundez.com\/codevolution\/"},{"@type":"ListItem","position":2,"name":"Setup B\u00e1sico para Proyectos de Python: Gu\u00eda para Principiantes"}]},{"@type":"WebSite","@id":"https:\/\/martafagundez.com\/codevolution\/#website","url":"https:\/\/martafagundez.com\/codevolution\/","name":"CODEvolution","description":"Blog de Marta Fag\u00fandez","publisher":{"@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/martafagundez.com\/codevolution\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":["Person","Organization"],"@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/3e1e66d60048c83d5dff039f53b615e1","name":"Marta Fag\u00fandez","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/image\/","url":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2023\/08\/marta_fagundez_developer_avatar1.png","contentUrl":"https:\/\/martafagundez.com\/codevolution\/wp-content\/uploads\/2023\/08\/marta_fagundez_developer_avatar1.png","width":603,"height":603,"caption":"Marta Fag\u00fandez"},"logo":{"@id":"https:\/\/martafagundez.com\/codevolution\/#\/schema\/person\/image\/"},"description":"Aqu\u00ed comparto algunos de mis aprendizajes como desarrolladora web. Si alguno de mis art\u00edculos te ha resultado \u00fatil, me alegrar\u00eda saberlo ;)","sameAs":["https:\/\/martafagundez.com","https:\/\/www.linkedin.com\/in\/martafagundezrodriguez","https:\/\/www.youtube.com\/@martafagundez"],"url":"https:\/\/martafagundez.com\/codevolution\/author\/marta\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/posts\/1552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/comments?post=1552"}],"version-history":[{"count":32,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/posts\/1552\/revisions"}],"predecessor-version":[{"id":1681,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/posts\/1552\/revisions\/1681"}],"wp:attachment":[{"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/media?parent=1552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/categories?post=1552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/martafagundez.com\/codevolution\/wp-json\/wp\/v2\/tags?post=1552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}