commited all contents created by participants
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
#rechercher et compiler une expression reguliere
|
||||
prose = re.compile(r"\w+.+rill+.+\s(\w*\s\w*\s\w*\s)\w*")
|
||||
prose2 = re.compile(r"(\w*\s\w*\s\w*)\s\w+.+rill+.+\s\w*")
|
||||
|
||||
#ouvrir un fichier texte
|
||||
with open("how_2_use_drill.txt", "r" ) as source:
|
||||
for line in source:
|
||||
#créer une ligne de texte avec l'expression reg prélevé dans le texte
|
||||
newtext = prose2.findall(line)
|
||||
# newtext = prose.findall(line)
|
||||
#firstLine =
|
||||
print(''.join(newtext))
|
||||
|
||||
|
||||
# with open('export.txt', 'w') as f:
|
||||
# f.write()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user