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/09/24 07:36] – [Liste en compréhension] villersd
Ligne 22: Ligne 22:
   * [[https://gist.github.com/bearfrieze/a746c6f12d8bada03589]]   * [[https://gist.github.com/bearfrieze/a746c6f12d8bada03589]]
   * [[https://medium.com/code-85/a-beginners-guide-to-python-list-comprehensions-7dbb0039f065|A Beginner’s Guide to Python List Comprehensions]] (Jonathan Hsu, Medium, 23/04/2020)   * [[https://medium.com/code-85/a-beginners-guide-to-python-list-comprehensions-7dbb0039f065|A Beginner’s Guide to Python List Comprehensions]] (Jonathan Hsu, Medium, 23/04/2020)
 +  * [[https://iam-akshay.medium.com/python-one-liner-superb-tricks-c611aad98553|Python one-liner superb tricks]] Akshay Jain, Medium, 16/04/2022
 +
  
 ===== map, filter, reduce, lambda, pipe ===== ===== map, filter, reduce, lambda, pipe =====
   * [[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 112:
 ===== 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