diff --git a/basic-python/bonjour_python.py b/basic-python/bonjour_python.py new file mode 100644 index 0000000000000000000000000000000000000000..46674a1ae92271da29842511f5409c91b05847c2 --- /dev/null +++ b/basic-python/bonjour_python.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Programme basique Python. +""" + +import sys + +if __name__ == '__main__': + if len(sys.argv) > 1: + prenom = sys.argv[1] + else: + prenom = "inconnu" + + print("Bonjour {0}".format(prenom)) + + print(f"Bonjour {prenom}") diff --git a/doc/accueil.md b/doc/accueil.md index e806009634d4f689f71abccf4d03f2869e6b10eb..9e7ce5a864794dfcea1c8d35fbb729cfc50334df 100644 --- a/doc/accueil.md +++ b/doc/accueil.md @@ -12,3 +12,7 @@ [Encodages](encodages.md) +# Langage Python + +[Langage Python](langage-python.md) + diff --git a/doc/langage-python.md b/doc/langage-python.md new file mode 100644 index 0000000000000000000000000000000000000000..601cebcfb77ff5afb0fbd907b7fa54e1689d166e --- /dev/null +++ b/doc/langage-python.md @@ -0,0 +1,65 @@ +# Langage de programmation Python + +## Information générales + +1. [site web du langage](https://www.python.org/) +2. [Documentation du langage](https://docs.python.org/3/) + +## Librairie standard + +### http.server + +Pour lancer un petit serveur web dans le répertoire courant : + +```shell +$ python -m http.server 2000 +``` + +Librairie [http.server](https://docs.python.org/3/library/http.server.html) + +## Requests + +Librairie permettant de faire des requêtes HTTP + +[Documentation Requests](http://docs.python-requests.org/en/master/) + +```python +import requests + +resp = requests.get("https://en.wikipedia.org/wiki/Web_colors") +resp.status_code +resp.headers +resp.request +resp.request.headers +resp.request.body +resp.request.url +``` + +## SQLAlchemy + +Librairie d'accès à une base de données. + +[Site web SQLAlchemy](https://www.sqlalchemy.org/) +[Documentationi SQLAlchemy](https://docs.sqlalchemy.org/en/14/) + +## Beautiful Soup + +Librairie pour extraire des éléments de pages HTML. + +[Site web Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/) +[Documentation Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) + +## Pandas + +Librairie de manipulation de données. + +[Site web Pandas](https://pandas.pydata.org/) +[Documentation Pandas](https://pandas.pydata.org/docs/) + + +## matplotlib + +Création de graphiques, notamment via Pandas. + +[Site web matplotlib](https://matplotlib.org/) +