19 October 2012 Python: Exemple d’utilisation de anydbm pour accéder à une base de données Les Bibliothèques Standards import anydbm db = anydbm.open("Ma_Base_de_Donnees", "c") db["1"] = "Nom" db["2"] = "Prénom" db["3import anydbm db = anydbm.open("Ma_Base_de_Donnees", "c") db["1"] = "Nom" db["2"] = "Prénom" db["3 python
14 October 2012 Python: Ajouter le méchanisme de persistance à une Base de données Les Bibliothèques Standards import shelve db = shelve.open("ma_base_de_donnees", "c") db["Nom"] = 'Will' db["Prenom"] = 'Smit import shelve db = shelve.open("ma_base_de_donnees", "c") db["Nom"] = 'Will' db["Prenom"] = 'Smit python
12 August 2012 Obtenir le texte d’un élément à l’aide d’un spécificateur XPath XML from xml.dom import minidom from xml.xpath import Evaluate doc = minidfrom xml.dom import minidom from xml.xpath import Evaluate doc = minid python
11 August 2012 Python: Lire les emails d’un serveur Mail Réseaux import mailbox mailboxname = "/home/localWeb/Mail/inbox" # Le répertoire qui contient les import mailbox mailboxname = "/home/localWeb/Mail/inbox" # Le répertoire qui contient les python
4 August 2012 MIME: Attacher un fichier à un email Réseaux import os from email import * import smtplib from email.mime.text import MIMEText from email.mime.muimport os from email import * import smtplib from email.mime.text import MIMEText from email.mime.mu python
26 July 2012 Extraire les emails d’un serveur Mail POP3 Réseaux import poplib import getpass #Ouverture d'une connexion serveur = poplib.POP3('mail.exemple.com')import poplib import getpass #Ouverture d'une connexion serveur = poplib.POP3('mail.exemple.com') python
14 July 2012 Python: Exemple d’envoi d’email Réseaux import smtplib import string host = "www.serveur.net" FROM = "contact@xxx.net" import smtplib import string host = "www.serveur.net" FROM = "contact@xxx.net" python
9 July 2012 Python: Envoi d’email à l’aide de module ‘smtplib’ Réseaux import smtplib def envoi_email(de, a, message): """ Fonction simple d'envoi d'email avec pythonimport smtplib def envoi_email(de, a, message): """ Fonction simple d'envoi d'email avec python python
2 July 2012 Python: Envoi d’email avec le protocole SMTP Réseaux import smtplib def envoi_email(_from, to, msg): serveur=smtplib.SMTP('www.exempl import smtplib def envoi_email(_from, to, msg): serveur=smtplib.SMTP('www.exempl python
28 June 2012 Python: Exemple de lecture d’un fichier email Réseaux import email def read_MSG(file): """ Lire un fichier""" fichier_email = open(file)import email def read_MSG(file): """ Lire un fichier""" fichier_email = open(file) python