Los mejores tutoriales de Python

Python es un lenguaje de programación de propósito general que se escribe, interpreta y es conocido de forma dinámica por su fácil lectura con excelentes principios de diseño.

freeCodeCamp tiene uno de los cursos más populares en Python. Es completamente gratis (y ni siquiera tiene publicidad). Puedes verlo en YouTube aquí.

¿Querer aprender más?

La web es un lugar grande, hay mucho más por explorar:

  • Libro de práctica de Python: //anandology.com/python-practice-book/index.html
  • Piense en Python: //greenteapress.com/thinkpython/html/index.html
  • Python empresarial práctico: //pbpython.com/
  • Otro curso: //realpython.com/?utm source = fsp & utm medium = promo & utm_campaign = bestresources
  • General: //www.fullstackpython.com/
  • Aprenda los conceptos básicos: //www.codecademy.com/learn/learn-python
  • Ciencias de la computación usando Python: //www.edx.org/course/introduction-computer-science-mitx-6-00-1x-11?ref=hackernoon#!
  • Lista de más recursos para aprender python: //github.com/vinta/awesome-python
  • Python interactivo: //interactivepython.org/runestone/static/thinkcspy/index.html
  • Guía del desarrollador de Python: //devguide.python.org/

¿Para qué se usa Python?

Python se puede usar fácilmente para proyectos pequeños, grandes, en línea y fuera de línea. Las mejores opciones para utilizar Python son el desarrollo web, secuencias de comandos simples y análisis de datos. A continuación se muestran algunos ejemplos de lo que Python le permitirá hacer:

Desarrollo web:

Puede utilizar Python para crear aplicaciones web en muchos niveles de complejidad. Hay muchos frameworks web de Python excelentes, incluidos Pyramid, Django y Flask, por nombrar algunos.

Análisis de los datos:

Python es el lenguaje principal elegido por muchos científicos de datos. Python ha ganado popularidad en el campo debido a la disponibilidad de muchas bibliotecas excelentes centradas en la ciencia de datos (de las cuales NumPy y Pandas son dos de las más conocidas) y la visualización de datos (como Matplotlib y Seaborn). Pyton realmente hizo que el procesamiento de datos fuera divertido con todas sus numerosas bibliotecas disponibles. Ipython con JupyterLab es otra forma de Python que mejora el uso de Python en el campo de la ciencia de datos.

Automatización:

Python es un lenguaje muy flexible que se puede utilizar para automatizar tareas aburridas o repetitivas. Los administradores del sistema a menudo lo utilizan escribiendo scripts que se pueden ejecutar fácilmente desde la terminal. Python también se puede utilizar para crear bots que automatizan algunas de nuestras tareas diarias.

Inteligencia artificial:

Python también se usa ampliamente en el creciente campo de la Inteligencia Artificial (IA). Google seleccionó Python para ser uno de los primeros lenguajes de programación con soporte para entrenar e interactuar con modelos usando Tensorflow.

Desarrollo de aplicaciones móviles

Se pueden crear aplicaciones y juegos móviles con python usando Kivy, Pygame y PyQt.

Seguridad y redes:

Python se utiliza para crear herramientas de red y herramientas de seguridad que se utilizan ampliamente. La automatización remota de Python es la más segura, rápida y eficiente para la prueba de frameworks en la nube. Es por eso que los desarrolladores profesionales usan Python para crear los marcos más seguros y para la programación de sockets.

Aprendizaje automático, aprendizaje profundo

Python es uno de los mejores lenguajes adecuados para el aprendizaje automático, el aprendizaje profundo y el análisis de datos con una fortaleza en todos ellos.

Hay lenguajes especializados que se adaptan mejor a varios roles, como R y MATLAB, pero cuando se trata de campos de aplicaciones superpuestos, Python gana sin lugar a dudas debido a su flexibilidad y rápida creación de prototipos y disponibilidad de bibliotecas.

Desarrollo de Telegram Bots

Puede usar Python y algunas bibliotecas de Python para desarrollar sus propios Telegram Bots.

Recopilación de datos mediante rastreo y extracción

Python también se puede utilizar para analizar los códigos fuente de las páginas y recuperar sus datos. ¡Usar algunos módulos de Python, como Scrapy y también (para algunas páginas que usan javascript) Selenium debería funcionar!

Python se usa generalmente para

  • Desarrollo Web e Internet
  • Avance educativo
  • Estudios científicos / Computación
  • Desarrollo de escritorio
  • Computación numérica
  • Desarrollo de software
  • Desarrollo de aplicaciones comerciales
  • Aprendizaje automático
  • IOT
  • Desarrollo de juegos
  • Prototipos rápidos
  • Automatización del navegador
  • Data analysis
  • Scraping data from websites
  • Image Processing

Some articles covering the usability of python

  • 10 Major Uses of Python
  • Applications for Python
  • Where is the Python Language Used?
  • What is Python used for?

The official package index for python is here.

Should you use Python 2 or Python 3?

The two versions are similar. If you know one, switching to writing code in the other is easy.

  • Python 2.x will not be maintained past 2020.
  • 3.x is under active development. This means that all recent standard library improvements, for example, are only available by default in Python 3.x.
  • Python ecosystem has amassed a significant amount of quality software over the years. The downside of breaking backwards compatibility in 3.x is that some of that software (especially in-house software in companies) still doesn’t work on 3.x yet.

Installation

Most *nix based operating systems come with Python installed (usually Python 2, Python 3 in most recent ones). Replacing your system's default installation of Python is not recommended and may cause problems. However, different versions of Python can be safely installed alongside your system's default version. See Python Setup and Usage.

Windows doesn’t come with Python, but the installer and instructions can be found here.

Python Interpreter

The Python interpreter is what is used to run Python scripts.

If it is available and in Unix shell’s search path, it's possible to start it by typing the command python followed by the script name. This will invoke the interpreter and run the script.

hello_campers.py

print('Hello campers!')

From the terminal:

$ python hello_campers.py Hello campers!

When multiple versions of Python are installed, calling them by version is possible depending on the install configuration. In the Cloud9 IDE custom environment, they can be invoked like:

$ python --version Python 2.7.6 $ python3 --version Python 3.4.3 $ python3.5 --version Python 3.5.1 $ python3.6 --version Python 3.6.2 $ python3.7 --version Python 3.7.1

Python Interpreter Interactive Mode

Interactive mode can be started by invoking the Python interpreter with the -i flag or without any arguments.

Interactive mode has a prompt where Python commands can be entered and run:

$ python3.5 Python 3.5.1 (default, Dec 18 2015, 00:00:00) GCC 4.8.4 on linux Type "help", "copyright", "credits" or "license" for more information. >>> print("Hello campers!") Hello campers! >>> 1 + 2 3 >>> exit() $

The Zen of Python

Some of the principles that influenced the design of Python are included as an Easter egg and can be read by using the command inside Python interpreter interactive mode:

>>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!

Pros and Cons of Python

Pros

  1. Interactive language with a module support for almost all functionality.
  2. Open Source: So, you can contribute to the community, the functions you have developed for future use and to help others
  3. A lot of good interpreters and notebooks available for better experience like jupyter notebook.

Cons

  1. Being open source, many different ways have developed over the years for the same functions. This sometimes creates chaos for others to read someone's else code.
  2. It is a slow language. So it's a very bad language to use for developing general algorithms.

Documentation

Python is well documented. These docs include tutorials, guides, references and meta information for language.

Another important reference is the Python Enhancement Proposals (PEPs). Included in the PEPs is a style guide for writing Python code, PEP 8.

Debugging

Inline print statements can be used for simple debugging:

… often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.

Executive Summary

Python also includes more powerful tools for debugging, such as:

  • logging module, logging
  • debugging module, pdb

Just note that these exist for now.

Hello World!

Going back to the docs, we can read about the print function, a built-in function of the Python Standard Library.

print(*objects,, end="\n", file=sys.stdout, flush=False)

The built-in functions are listed in alphabetical order. The name is followed by a parenthesized list of formal parameters with optional default values. Under that is a short description of the function and its parameters are given and there is occasionally an example.

The print function in Python 3 replaces the print statement in Python 2.

>>> print("Hello world!") Hello world!

A function is called when the name of the function is followed by (). For the Hello world! example, the print function is called with a string as an argument for the first parameter. For the rest of the parameters the defaults are used.

The argument that we called the print function with is a str object or string, one of Python’s built-in types. Also the most important thing about python is that you don’t have to specify the data type while declaring a variable; python’s compiler will do that itself based on the type of value assigned.

The objects parameter is prefixed with a * which indicates that the function will take an arbitrary number of arguments for that parameter.