IDE Setup for Python¶
While a proper IDE is not strictly needed to develop python code, its usage will make the development process easier and more efficient, allowing the programmer to interact with the code in ways not possible with a text editor.
VSCode¶
We recommend the usage of VSCode for Python development, while other excellent IDEs exist, the following VSCode features are of great value:
- Remote SSH connection:
Use any machine with VSCode installed to connect to a remote machine and continue developing on it, e.g. you can store your files onafs
and connect to them throughlxplus
, working on them as if they were present locally. Check the CERN Knowledge Base for more information. - Python support:
Make use of static type checking and auto-completion. Interact with the code via an easy-to-use debugger. - Debugging:
Enables you to stop your program at any point and interact with it as well as inspect variables and their values. - Interactive Python:
Use any script as if it were a jupyter notebook, allowing you to run code snippets in real time and inspect variables. - Integrated Testing:
Use thepytest
framework to easily write and run tests, which can be individually run or all at once directly from the editor. - Great Extendibility:
Many extensions are available, making VSCode a great tool for many different use cases and programming languages (e.g. LaTeX, Java, which means you do not have to learn a new environment for your different projects. - Widespread use among the team:
Most developers of the OMC-Team use VSCode and are happy to help you with setting up and using it.
Recommended Extensions¶
Main:
- Python: Documentation
- Jupyter: Documentation
- Remote SSH: Documentation and lxplus SSH configuration.
Additional:
- Ruff: A fast Python linter.
- Github Pull Requests: Interact with Github pull requests directly from VSCode.
- Markdown Table Formatter: Format tables in markdown files.