Installation
https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
dnf check-update
sudo dnf install code
Install Python3 on RHEL, Fedora, or CentOS
sudo dnf install python3
The built-in Python 3 installation on Linux works well, but to install other Python packages you must install pip with get-pip.py
https://pip.pypa.io/en/stable/installation/#get-pip-py
Install Python Extension in VS Code
https://code.visualstudio.com/docs/python/python-tutorial
Start VSCode.
$ code
Open View -> Extension and type python and install .
Setup python interpreter in VSCode
- Opening the Command Palette (Ctrl+Shift+P)
- And type "Python: Select Interpreter"
- And select recommended python
Write and Execute Simple Python Script
Create a new file hello.py
#!/usr/bin/env python3
print("Hello World!")
Run from VSCode by pressing Ctrl+F5.
Execute from command line.
$ chmod +x tmp/hello.py
$ tmp/hello.py
No comments:
Post a Comment