Try https://pypi.python.org/pypi/vulture
There are some Python IDE's which will mark unused variables or code which is not used. Sublime Text will do it, I think. May be Atom too.
Edit:
I've wrote this simple code:
I've tried pychecker, pyflakes and vulture. Only the last one has printed out some result.
There are some Python IDE's which will mark unused variables or code which is not used. Sublime Text will do it, I think. May be Atom too.
Edit:
I've wrote this simple code:
#!/usr/bin/env python3 import sys a = 2 b = 3 c = 4 def print_hw(): print("hello, world") def add_nums(x, y): return x + y def main(): print(add_nums(a, b)) print(dir(__name__)) if __name__ == '__main__': sys.exit(main())So, Sublime, Atom and Ninja IDE, no one of these has showed the unused code...
I've tried pychecker, pyflakes and vulture. Only the last one has printed out some result.
victor@jerry:~$ vulture -v dead_code_test.py | grep 'Unused' dead_code_test.py:6: Unused variable 'c' dead_code_test.py:9: Unused function 'print_hw'