teaching:progappchim:notions_avancees

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
teaching:progappchim:notions_avancees [2022/03/29 00:29] villersdteaching:progappchim:notions_avancees [2022/04/28 10:20] – [Transformations et manipulations de chaînes (string)] villersd
Ligne 26: Ligne 26:
   * [[https://towardsdatascience.com/write-clean-python-code-using-pipes-1239a0f3abf5|Write Clean Python Code Using Pipes - A Short and Clean Approach to Processing Iterables]] Khuyen Tran, medium, october 2021   * [[https://towardsdatascience.com/write-clean-python-code-using-pipes-1239a0f3abf5|Write Clean Python Code Using Pipes - A Short and Clean Approach to Processing Iterables]] Khuyen Tran, medium, october 2021
   * ...   * ...
 +
 +===== Le rôle du caractère underscore en Python =====
 +  * [[https://www.datacamp.com/community/tutorials/role-underscore-python|Role of Underscore(_) in Python Tutorial - In this tutorial, you're going to learn about the uses of underscore(_) in python]] Hafeezul Kareem Shaik, Medium (DataCmap) October 26th, 2018
 +  * [[https://www.geeksforgeeks.org/underscore-_-python/]]
  
 ===== Transformations et manipulations de chaînes (string) ===== ===== Transformations et manipulations de chaînes (string) =====
Ligne 106: Ligne 110:
 ===== emails ===== ===== emails =====
 smtplib et poplib : smtplib et poplib :
-  * +  * [[https://twitter.com/driscollis/status/1508506999268552713]] 
 +  * [[https://twitter.com/driscollis/status/1508570173606928386]] 
 + 
 +<code python> 
 +import smtplib  
 + 
 +HOST = "smtp.mydomain.com" 
 +SUBJECT = "Test email from Python" 
 +TO = "mike@mydomain.com" 
 +FROM = "python@mydomain.com" 
 +text = "blah blah blah" 
 +BODY = "\r\n".join(( 
 +    f"From: {FROM}", 
 +    f"To: {TO}", 
 +    f"Subject: {SUBJECT}", 
 +    "", 
 +    text)  
 +
 +server = smtplib.SMTP(HOST) 
 +server.sendmail(FROM, [TO], BODY) 
 +server.quit()  
 +</code> 
 + 
 +<code python> 
 +import poplib 
 + 
 +mailbox = poplib.POP3('pop3.host.com'
 +mailbox.user("USERNAME"
 +mailbox.pass_("PASSWORD"
 +numMessages = len(mailbox.list()[1]) 
 +for i in range(numMessages): 
 +    for j in mailbox.retr(i+1)[1]: 
 +    print(j)  
 +</code>
  
 ===== Création et gestion de packages ===== ===== Création et gestion de packages =====
  • teaching/progappchim/notions_avancees.txt
  • Dernière modification : 2023/05/02 10:36
  • de villersd