Previous: 15-ClassesInheritance.html
document.querySelector('video').playbackRate = 1.2
#!/bin/bash
# Install once.
sudo zypper/dnf/apt install python3-black
# or
pip3 install --upgrade black --user
# Run whenever
black sonar_improved.py
# or
black *.py
+++++++++++ Cahoot-16-1
https://mst.instructure.com/courses/58101/quizzes/56633
#!/bin/bash
# Install once
sudo zypper/dnf/apt install mypy python3-mypy
pip3 install --upgrade monkeytype mypy --user
# Show files above
vim sonar_improved.py sonar_original.py monkey_wrapper.py
monkeytype run monkey_wrapper.py
monkeytype apply sonar_improved.py
ipython
versus python
#!/bin/bash
# Install once
sudo zypper/dnf/apt install python3-ipython
ipython3
# Run whenever
vim sonar_improved.py
# Introduce error?
ipython3 sonar_improved.py
# Fix the error
ll sonar_improved
chmod -x sonar_improved.py
ll
./sonar_improved.py
chmod +x sonar_improved.py
# Show the shebang
sudo zypper/dnf/apt install python3-pudb python3-spyder
pip3 install –upgrade pudb spyder –user
pudb sonar_improved.py
spyder3 sonar_improved.py &
+++++++++++ Cahoot-16-2
https://mst.instructure.com/courses/58101/quizzes/56634
### 5. Review of linting and how to use tips
https://pylint.org
``` {.sh .numberLines}
#!/bin/bash
# Install once
sudo zypper/dnf/apt install python3-pylint python3-spyder
pip3 install --upgrade pylint spyder --user
# Install linting additions to your favorite text editor (optional)
# Run whenever
pylint sonar_improved.py
vim sonar_improved.py
spyder3 sonar_improved.py &
+++++++++++ Cahoot-16-3
https://mst.instructure.com/courses/58101/quizzes/56635
#!/bin/bash
sudo zypper/apt/dnf install meld
man meld
meld --diff sonar_original.py sonar_improved.py
man vimdiff
vim -d sonar_original.py sonar_improved.py
man diff
diff -y --color sonar_original.py sonar_improved.py
git init
git add .
git commit -m "init"
cp sonar_improved.py sonar_original.py
git diff sonar_improved.py
Control flow graph:
https://en.wikipedia.org/wiki/Control-flow_graph
* py2cfg
* https://py2cfg.readthedocs.io/en/latest/
* https://gitlab.com/classroomcode/py2cfg
* https://pypi.org/project/py2cfg/
Calls: https://en.wikipedia.org/wiki/Call_graph
* pycallgraph
* https://pycallgraph.readthedocs.io/en/master/
* https://pypi.org/project/pycallgraph/
* https://github.com/gak/pycallgraph
UML class diagram: https://en.wikipedia.org/wiki/Class_diagram
* https://pylint.org
* Contains pyreverse
* http://epydoc.sourceforge.net/
* https://modeling-languages.com/uml-tools/#python
* https://sungsoo.github.io/2018/03/21/uml-tools-for-python.html
* https://pynsource.com/
#!/bin/bash
sudo zypper/dnf/apt install python3-pylint
# or
pip3 install pylint --user
pyreverse -o svg somethingwithclasses.py
ls
See 15-ClassesInheritance for examples.
Text documentation generation?
* https://wiki.python.org/moin/DocumentationTools
*
https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html
Next: 17-Exceptions.html