Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

DOSSIER DES ENREGISTREMENTS

OFPPT
CONTROLE CONTINU N°3
CF HAY NAHDA

Module N° M106
AUTOMATISATION DES TÄCHES D’ADMINISTRATION
Filière : ID Durée : 1H30
Année : 1°A Note finale : / 20
Nom&Prénom du Formateur BENKHAYI ASMAE Émargement

QUESTIONS :

Exercice 1 : (6 Points)
Nom : ………………………………………......................... Prénom : ………………………………………………………….
1) Compléter le programme suivant avec les mots suivant line,file,root (3pts)
Groupe : ………………………………………………………….
File=’/etc/passwd’
with open(-----; 'r') as f :
for ---- in f.readlines() :
if ‘--------’ in ‘-------:
print(line)

………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..

2) Expliquez le rôle du programme (3pts)

………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..

Exercice 2 : (8 pts)

Soit le fichier excel « D:\Etudiants.csv » avec le contenu suivant :

Code : DE/EFM/079
Complexe de Formation Hay Nahda
Édition :04
Date : 20/11/2019
Rue Warfel Hay Nahda II B.P. 5673 Rabat
Page 1 sur 2
 : 053763 00 21 – Fax : 0537 75 30 77
DOSSIER DES ENREGISTREMENTS

OFPPT
CONTROLE CONTINU N°3
CF HAY NAHDA

Ecrire un script PowerShell qui permet de lire le contenu du fichier « D:\Etudiants.csv », puis crée la
liste des utilisateurs contenu dans le fichier (Utilisez une boucle). (8 Points)

………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………………………..

Exercice 3 : Fichier logs (6 Points)


Expliquez les différents lignes du code suivant : (6 Points)

1. import logging
2. logging.basicConfig(filename='test_log.log',level=logging.DEBUG,\
3. format='%(asctime)s -- %(name)s -- %(levelname)s -- %(message)s')
4. logging.debug('Debug error')
5. logging.info('INFO ERROR')
6. logging.warning('Warning Error %s: %s', '01234', 'Erreur Oracle')
7. logging.error('error message')
8. logging.critical('critical error')

………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………

Code : DE/EFM/079
Complexe de Formation Hay Nahda
Édition :04
Date : 20/11/2019
Rue Warfel Hay Nahda II B.P. 5673 Rabat
Page 2 sur 2
 : 053763 00 21 – Fax : 0537 75 30 77

You might also like