Tools to develop Python code#
We’ve seen that Python is characterized by:
Interpreted (but there are tools to compile Python code)
Dynamically strongly typed
Indentation defines the blocks
Style coding is important: pep8
The editor can and has to help you!!
syntax coloring
automatic indentation
code analysis (code analysis powered by
pyflakes
andpylint
)introspection capabilities such as code completion
(short introduction)
Linters, formatters and type checkers
Documentation (get and write docstrings) and comments
Testing (principle and very basic realization with
assert
)Editors / IDE (JupyterLab, VSCode/VSCodium and Spyder)
basis
main extensions for Python
debug
sync configuration
overall comparison between these IDEs
Where and how to find and get help#
Sites (https://stackoverflow.com, …)
Lists (python@services.cnrs.fr, …)
Forums (https://discuss.python.org/, …) and chats
Generative AI: tools, consequences, how to ask?
Exercise 1 (PEP8 checker with Spyder editor)
In Spyder, open the file ./pyfiles/wrong.py
and see what append.
Activate the “Real time code style analysis (PEP 8)” (Preferences -> Editor -> Code Introspection/Analysis).
Correct the file to remove the warnings.