'module' object is not callable
>>> import pyfancy
>>> pyfancy().red("Hello, world!").output()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
Workaround:
from pyfancy import pyfancy
pyfancy.pyfancy().red("Hello, world!").output()
Are you running with Python 2 or 3?
~~This used to be documented somewhere in the README. (It said something along the lines of "use from pyfancy import *")~~
This is in fact documented in the README on the last line of the 'Usage' section.
I don't remember if this is due to a quirk in Python's namespacing that prevents us from allowing it to be used as import pyfancy, or if it's just because I don't know how Python works.
@TheMonsterFromTheDeep that doesnt fix it:
>>> from pyfancy import *
>>> pyfancy().red('aaaaa bbbbb')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
it would need to be like this:
>>> from pyfancy.pyfancy import pyfancy
>>> pyfancy().red('aaaaa bbbbb')
<pyfancy.pyfancy.pyfancy object at 0x6ffffd43d30>
@cup Sadly the last time I worked on this project was years ago, so I can't say for sure what changed in the meantime.
I'll change the documentation to say from pyfancy.pyfancy import pyfancy so that at least it's usable...
@TheMonsterFromTheDeep you rock - thanks!