1
One more basic question on my part. I am 'Pythonist' super basic level and I am simply trying to read a text line by line and make a split
each time I find a punctuation mark or a space.
I tried that:
import re
with open('est.txt', 'r') as f:
for ligne in f:
ligne=re.split('; |, |\s|\.|\n')
print (ligne)
Only I have the following mistake:
Traceback (most recent call last): File "C:/Users/Janaina/Desktop/exo/stats_python/estpy.py", line 5, in <module> ligne=re.split('; |, |\s|\n') TypeError: split() missing 1 required positional argument: 'string'
Could someone help me? I know it’s something super basic, but I’ve been blocked for some time looking for the answer...