I am trying to use the following python module:
import re
test = 'some text'
find = re.findall(r'text', test)
print(find)
When i try to run it in sublime, it writes:
AttributeError: module 're' has no attribute 'findall'
If i try to run it in Cygwin, there is a message:
AttributeError: 'module' object has no attribute 'findall'
But if i use attibute "findall" in python console, it works without any problem. I really don't undestand, what's wrong. In Sublime i use python 3.5.1, cygwin uses python 3.4.3, as i remember.
If you have a file called re.py
, then when you try and import re
, Python may look inside that file instead of inside the standard module re
. So don't name a file re.py
(or the name of any other module you want to import).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With