Перші кроки 👣⚓
В цьому розділі описано основні кроки для початку програмування на Python або Rust.
Python 🐍⚓
Встановлення 🔌⚓
- Просто завантажте файл
.exe; - Встановіть його;
- Додайте Python до системного
PATH(для нього повинен бути ); - Встановіть для опції "install for all users";
- Download archive;
- Extract it;
- Go go extracted folder;
-
Use these commands:
./configure- prepare for installation;make- extract / download / check files;make test- to rust CPython tests before installation;make altinstall- to install new version together with already installed, without change the default one;
Info
All commands can require
sudoaccess (but it depends).Danger
If you need override your current python enterpreter with new one, use can use
make install.
Virtual Environment 🔮✨⚓
For Python 🐍 projects are best practices to use different Python versions and separate installed versions for dependencies.
Here is another good option to manage virtual environments, called Poetry:
Poetry Poetry - Managing environments
Code Formatters 🧾⚓
Python has no standard auto formatters included to it 😢.
Several of common community formatters is:
black - code formatter; isort - imports formatter;
Rust 🦀⚓
Installation 🔌⚓
To install Rust it's better to use the official method via rustup (this is Rust toolchain).
Virtual Environment 🔮✨⚓
Rust 🦀 no need to manage virtual environment in such way like a Python, because every package
(called Crate in Rust) is separated from others and it builds at compile time.
To manage dependencies and crates in Rust toolchain - exists Cargo.
Code Formatters 🧾⚓
Rust has standard formatter called rustfmt.
You can call it directly from Cargo inside your crate:
Or from rustfmt by one file: