python setup.py uninstall

Note: Avoid using python setup.py install use pip install . You need to remove all files manually, and also undo any other stuff that installation did manually. If you don’t know the list of all files, you can reinstall it with the –record option, and take a look at the list this produces. To record a list of installed files, … Read more

scrapy run spider from script

It is simple and straightforward 🙂 Just check the official documentation. I would make there a little change so you could control the spider to run only when you do python myscript.py and not every time you just import from it. Just add an if __name__ == “__main__”: Now save the file as myscript.py and run ‘python myscript.py`. Enjoy!

Official abbreviation for: import scipy as sp/sc

The “official” answer, according to the Scipy documentation, is that there is really no reason to ever since all of the interesting functions in Scipy are actually located in the submodules, which are not automatically imported. Therefore, the recommended method is to use then, functions can be called with Personally, I always use and live with … Read more

Recursion in Python? RuntimeError: maximum recursion depth exceeded while calling a Python object

Python lacks the tail recursion optimizations common in functional languages like lisp. In Python, recursion is limited to 999 calls (see sys.getrecursionlimit). If 999 depth is more than you are expecting, check if the implementation lacks a condition that stops recursion, or if this test may be wrong for some cases. I dare to say that … Read more

TypeError: argument of type ‘NoneType’ is not iterable

If a function does not return anything, e.g.: it has an implicit return value of None. Thus, as your pick* methods do not return anything, e.g.: the lines that call them, e.g.: set word to None, so wordInput in getInput is None. This means that: is the equivalent of: and None is an instance of NoneType which does not provide iterator/iteration functionality, so you get that type error. The fix … Read more