Useful tools for Python

Python Tutor

Free online Python code visualization, Python learning tool.

Python Tutor
Python Tutor

http://pythontutor.com/

Anaconda

Easy package management

Packed with many useful Python tools

Anaconda
Anaconda
Anaconda - Software
Anaconda – Software

https://www.anaconda.com/distribution/#download-section

Jupyter Notebook

Jupyter notebook is like a magic notebook for Python. It can be used to share Notes, algebra, data analytics, code etc easily.

Jupyter Notebook
Jupyter Notebook

https://jupyter.org/install

(We can use Anaconda to install it easily)

IPython

IPython is a interactive shell for Python.

Supports Automatic indenting, bash shell commands, many built-in functions etc.

https://ipython.org/

Skulpt

Skulpt is a online Python environment built via javascript. Use with CodeMirror, we can do basic Python programming.

Skulpt
Skulpt

http://skulpt.org/


How to: Create shortcut icon for Anaconda/Anaconda3 Navigator/Launch Anaconda Navigator in Linux/Debian/Ubuntu/Kali Linux (How to create desktop shortcuts in Linux)

(For how to install Anaconda and Anaconda Navigator: How to: Install Anaconda/Anaconda3 in Linux/Debian/Ubuntu/Kali Linux)

To Launch Anaconda Navigator via command line

If Anaconda is installed correctly. We should be able to launch anaconda navigator by using following command

anaconda-navigator
Launch anaconda-navigator
Launch anaconda-navigator

If the above command doesn’t work we need to add the anaconda3 path to environment, we can use following command (Replace “yourusername” to your real system username)

export PATH=/home/yourusername/anaconda3/bin:$PATH

(e.g. export PATH=/home/abc/anaconda3/bin:$PATH)

Now we should be able to use “anaconda-navigator” command to launch Anaconda Navigator.

To Launch Anaconda Navigator via Desktop shortcut/icon

We need to manually create desktop shortcut icon first

1 Create an empty file on desktop name it anaconda-navigator.desktop

2 Open the file and enter following contents

(Replace “abc” with your system username, or replace whole path if you have installed to other location rather than home directory)

#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Anaconda
Version=2.0
Type=Application
Exec=/home/abc/anaconda3/bin/anaconda-navigator
Icon=/home/abc/anaconda3/lib/python3.7/site-packages/anaconda_navigator/static/images/anaconda-icon-256x256.png
Comment=Open Anaconda Navigator
Terminal=false
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Anaconda
Version=2.0
Type=Application
Exec=/path/to/anaconda3/bin/anaconda-navigator
Icon=/path/to/anaconda3/lib/pythonVersion/site-packages/anaconda_navigator/static/images/anaconda-icon-256x256.png
Comment=Open Anaconda Navigator
Terminal=false
Anaconda desktop icon/shortcut
Anaconda desktop icon/shortcut

3 Although we can use the shortcut on desktop, it will not be listed in application screen/menu, we can use following command to make it appear in our application screen/menu as well

cp anaconda-navigator.desktop ~/.local/share/applications/
Copy shortcut to application menu/list
copy shortcut to application menu/list

4 Now it will appear in our application menu/list

Application menu/list
Application menu/list

Resource

Anaconda-Navigator – Ubuntu16.04


How to: Install Anaconda/Anaconda3 in Linux/Debian/Ubuntu/Kali Linux

(For how to launch Anaconda Navigator or create Anaconda Navigator shortcut: How to: Create shortcut icon for Anaconda/Anaconda3 Navigator/Launch Anaconda Navigator in Linux/Debian/Ubuntu/Kali Linux)

1 Download Anaconda3 from official website: https://www.anaconda.com/distribution/

https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh

2 Make it executable

2.1 We can right click on the file, then click on “Properties” -> “Permissions” -> Check “Allow this file to run as a program”

Assign execute permission
Assign execute permission

2.2 We can also use “chomd” command to assign execute permission

Related to chmod command: Unix/Linux (Ubuntu, Debian, Kali Linux etc.) Privilege Management

3 Launch the “Anaconda3-2019.10-Linux-x86_64.sh” to install Anaconda

Anaconda3-2019.10-Linux-x86_64.sh
Anaconda3-2019.10-Linux-x86_64.sh

3.1 Accept the license terms and install to user home directory

Accept the license terms and install to user home directory
Accept the license terms and install to user home directory

3.2 Let the installer to initialize Anaconda3 by running conda init by typing “yes” then hit Enter key

Type Yes, then hit Enter key
Type Yes, then hit Enter key

4 Now it’s installed if there is no error

(Installation on Windows and macOS is very simple, just download the correct binary file (.exe) form official website, execute, follow the steps to install, the shortcut will be create automatically on desktop and in start menu, all installation packages can be found here: https://www.anaconda.com/distribution/)


How to: upgrade/update Anaconda

Keywords: Python, anaconda, conda

Upgrade Anaconda & all packages to latest version:

1 Find and launch Anaconda Prompt

Anaconda from Windows start menu
Anaconda from Windows start menu

2 Using following command to update all packages including Anaconda itself

conda update --all
Anaconda Prompt -> conda update --all
Anaconda Prompt -> conda update –all
Anaconda Prompt -> conda update --all -> finished
Anaconda Prompt -> conda update –all -> finished

(Note: This way, it will drop all the version constraints from the history and tries to make everything as new as it can)

Bonus:

We can also use “conda update anaconda=VersionNumber” to update Anaconda to specified version

e.g.

conda update anaconda=1.9.7