Repository navigation
Python Notes
Alternative to idle3 is to use Atom.
To install Atom from the official RPM package provide by the Atom team (which is only suitable for 64-bit systems!) for the latest stable (as opposed to beta releases which are also packaged at RPMs) Atom release, run:
sudo dnf install $(curl -sL "https://api.github.com/repos/atom/atom/releases/latest" | grep "https.*atom.x86_64.rpm" | cut -d '"' -f 4)
While there is no official way to auto-update these binaries here is a ~/.bashrc (also compatible with the Zsh shell's ~/.zshrc file) snippet that will automatically check for available Atom updates and install them whenever one opens a terminal:
ATOM_INSTALLED_VERSION=$(rpm -qi atom | grep "Version" | cut -d ':' -f 2 | cut -d ' ' -f 2)
ATOM_LATEST_VERSION=$(curl -sL "https://api.github.com/repos/atom/atom/releases/latest" | grep -E "https.*atom-amd64.tar.gz" | cut -d '"' -f 4 | cut -d '/' -f 8 | sed 's/v//g')
if [[ $ATOM_INSTALLED_VERSION < $ATOM_LATEST_VERSION ]]; then
sudo dnf install -y https://github.com/atom/atom/releases/download/v${ATOM_LATEST_VERSION}/atom.x86_64.rpm
Create a top-level directory to maintain your projects.
$ mkdir /home/username/pyvenvs
Create a project folder then a virtual environment.
$ mkdir project1
$ cd project1
$ python3 -m venv env
$ ls env
bin include lib lib64 pyvenv.cfg
Activate the project1 virtual environment then launch Atom--use of python3 versus the system wide or non-virtual environment default, python2.
$ pwd
/home/username/pyvenvs/project1
$ . env/bin/activate <-- space after the "."
(env) $
$ atom
When done execute deactivate to exit the virtual environment.
On opening, Atom will display tabs:
- Welcome Guide: select "Open a Project" then browse, select, and click the OK button for the project1 folder.
- Welcome: remove the check to Show Welcome Guide on opening Atom
- Telemetrics: Disable or permit
Open Atom Settings pane by selecting "Edit" from the menu then Preferences.
Using "Settings" select "Install" then install "script" by rgbkrk.
Change selection from Packagesto Themes then install "predawn-syntax" by jamiewilson. Next, select "Themes" and select Predawn under Syntax Theme.
Using "Settings" select "Editor"
- Font Family: Source Code Pro
- Font Size: 20
- Scroll Past End: enable
- Tab Length: 4
Not a fan of auto-complete so disable it.
Using "Settings" select "Packages" then disable "autocomplete-plus" and "autocomplete-snippets."
If you desire auto-complete, consider using the Python specific one. You can install it, disable, then Enable as needed.
Using "Settings" select "Install" then install package "autocomplete-python."
Install package python-autopep8 then
- Format On Save: enable
- Install within venv
pip install autopep8 - Also, use
ctrl-alt-sto reformat code
Install package linter by steelbrain. After installation, it will prompt you to install linter-ui-default which in turns prompts you to install intentions and busy-signal`.
Install package linter-flake8 by AtomLinter, then install within venv pip install flake8.
- file-icons
- minimap
An alternative to virtual environments is to use the script package profile feature.
- ctrl+shift+p
- Enter script and select script: run options
- Enter command value as /usr/bin/python2 or python3 then save as a profile
- ctrl+shift+b and how do I select profile?