background preloader

Pythex: a Python regular expression editor

Pythex: a Python regular expression editor
Related:  P4

jQuery API Documentation Green Tea Press: Free Computer Science Books Trier en Python — Documentation tri Version du 23/12/2020 La fonction sorted Python dispose d’une fonction standard nommée sorted qui permet de trier toute collection d’objets comparables. Exemple du tri d’une liste de nombres : Ligne 1 : la liste L à trier.Ligne 2 : La fonction sorted est une fonction built-in du langage Python et triant une liste donnée, ici L .Lignes 3 et 11 : la fonction sorted crée une nouvelle liste (ici LL), qui est effectivement triée.Lignes 13 et 10 : La fonction sorted ne modifie pas la liste initiale. Exemple du tri d’une chaîne de caractères (qui est une collection) : s = "nectarine"L = sorted(s)print(L) ['a', 'c', 'e', 'e', 'i', 'n', 'n', 'r', 't'] On voit que les lettres composant la chaîne sont écrites dans la liste par ordre alphabétique. La fonction sorted renvoie toujours une liste même si on ne lui donne pas une liste en argument. Trier avec la méthode sort Une liste peut être triée avec la méthode sort : L=[65, 31, 9, 32, 81, 82, 46, 12]print(L)L.sort()print(L) Trier « à l’envers » ou encore

Crawling and Scraping Web Pages with Scrapy and Python 3 Introduction Web scraping, often called web crawling or web spidering, is the act of programmatically going over a collection of web pages and extracting data, and is a powerful tool for working with data on the web. With a web scraper, you can mine data about a set of products, get a large corpus of text or quantitative data to play around with, retrieve data from a site without an official API, or just satisfy your own personal curiosity. In this tutorial, you’ll learn about the fundamentals of the scraping and spidering process as you explore a playful data set. We’ll use Quotes to Scrape, a database of quotations hosted on a site designed for testing out web spiders. By the end of this tutorial, you’ll have a fully functional Python web scraper that walks through a series of pages containing quotes and displays them on your screen. The scraper will be easily expandable so you can tinker around with it and use it as a foundation for your own projects scraping data from the web. Output

Jeux Blockly : Labyrinthe Jeux BlocklyPuzzleLabyrintheOiseauTortueFilmMusiqueTutoriel de PondPondGénétiqueVous avez résolu ce niveau avec 1 ligne de JavaScript :Vous avez résolu ce niveau avec %1 lignes de JavaScript :Êtes-vous prêt pour le niveau %1 ?Êtes-vous prêt pour le prochain défi ?Titre :Sauvegarder et lier aux blocs. Lancer le programme que vous avez écrit.Exécuter le programmeArrêter le programme et réinitialiser le niveau.RéinitialiserAideOKAnnulerLogiqueBouclesMathématiquesTexteListesCouleurVariablesFonctionsUn problème est survenu avec la requête.Partagez vos blocs grâce à ce lien : %1Désolé, « %1 » ne correspond à aucun programme sauvegardé.Impossible de charger votre fichier enregistré. Peut être a-t-il été créé avec une autre version de Blockly ?Merci pour ce programme ! Ce niveau est très difficile.

25 Innovative Dashboard Concepts and Designs Dashboard design is a tricky business. The challenge is to communicate the key numbers in a straightforward way, while allowing users to drill down into the specifics. It is about avoiding clutter, about catering for personalisation, and about the prioritisation of the right metrics. It’s difficult to get right, but I think many of these examples have lots of good things going for them. We’ve brought together a showcase of innovative, stunningly beautiful dashboard concepts & designs to help inspire you. Panels Dashboard by Cosmin Capitanu Story Book by Cosmin Capitanu Ladderboard by Vivek Main Trainer / Admin Dashboard by Vladimir Babić Main Trainer / Admin Dashboard by Vladimir Babić To-Do Dashboard Spanish Flat Dashboard by Robin Marquez PhotoLytics Dashboard UI by Balraj Chana BeaconSoft Venue Page by Megan Fox Social Engagement Dash by Rovane Durso Dashboard by Olivier Zattoni Personal Dashboard by Florent Legrand Dashboard by Avinash Tripathi Web App Dashboard by Ben Garratt

Comment calculer l'age à partir d'une date de naissance en python ? Exemple de comment calculer l'age à partir d'une date de naissance en python: 1 -- Transformer une date de naissance en age,(exemple 1) Soit la date de naissance suivante 8 Juillet 1982: import datetimedob = datetime.date(1982,8,7) pour obtenir l'age de cette personne a la date d'aujourd'hui (16 juin 2020), on peut faire comme ceci def from_dob_to_age(born): today = datetime.date.today() return today.year - born.year - ((today.month, today.day) < (born.month, born.day)) ce qui donne ici from_dob_to_age(dob) 37 ans ! 2 -- Transformer une date de naissance en age (exemple 2) Autre exemple supposons que la date de naissance est une chaîne de caractères (string): dob = '1982-07-08' dans ce cas il faut d'abord convertir le string en datetime (voir Python string to datetime – strptime() pour plus de details), comme ceci: dob = datetime.datetime.strptime(dob, '%Y-%m-%d') et en peut ensuite utiliser la fonction ci-dessus: Soit la dataframe suivante: donne Convertir les elements de la colonne dob en datetime:

Collecting Data from the Web with Python and Beautiful Soup Introduction Many data analysis, big data, and machine learning projects require scraping websites to gather the data that you’ll be working with. The Python programming language is widely used in the data science community, and therefore has an ecosystem of modules and tools that you can use in your own projects. In this tutorial we will be focusing on the Beautiful Soup module. Beautiful Soup, an allusion to the Mock Turtle’s song found in Chapter 10 of Lewis Carroll’s Alice’s Adventures in Wonderland, is a Python library that allows for quick turnaround on web scraping projects. In this tutorial, we will collect and parse a web page in order to grab textual data and write the information we have gathered to a CSV file. Prerequisites Before working on this tutorial, you should have a local or server-based Python programming environment set up on your machine. Additionally, since we will be working with data scraped from the web, you should be comfortable with HTML structure and tagging.

Related: