JavaScript
x
5
1
import base64
2
if __name__ == '__main__':
3
res = base64.encodestring('srcdasd')
4
print(res)
5
I run in console python base64.py, get the below error message.
but i can run it in textMate correctly.
AttributeError: ‘module’ object has no attribute ‘encodestring’
Advertisement
Answer
The name of your file should not be base64.py, it collides with the module you’re using. Rename your file, that should solve it.