i0iKS

Testing Ubuntu Bionic, Thonny 2.1.16, Python 3.6.4, vPython
-----------------------------------------------------------

Machine Configuration:

  Linux, Ubuntu 64b,
  RAM 4GB, GRAM 128MB,
  CPU: 4 Cores,
  Network: Bridged
  iso: bionic-desktop-amd64.iso (daily build)

Build Virtualbox Guest Additions

  $ sudo apt-get install build-essential

Install Thonny, VPython

  $ sudo apt-get install python3-pip python3-dev \
                         tcl8.4 python3-tk python3-jedi

  $ cat ~/.profile | tail -n 3
  if [ -d "$HOME/.local/bin" ] ; then
      PATH="$HOME/.local/bin:$PATH"
  fi

  $ pip3 install thonny

Where is Thonny?, Quick launch..

  $ sudo find / -name 'thonny*'
  ..
  /home/virtu/.local/lib/python3.6/site-packages/thonny/res/thonny.png
  /home/virtu/.local/bin/thonny

  cat /usr/share/applications/thonny.desktop

  [Desktop Entry]
  Type=Application
  Name=Thonny
  GenericName=Python IDE
  Exec=/home/virtu/.local/bin/thonny %F
  Comment=Python IDE for beginners
  Icon=/home/virtu/.local/lib/python3.6/site-packages/thonny/res/thonny.png
  StartupWMClass=Thonny
  Terminal=false
  Categories=Education;Development;Debugger;IDE;
  MimeType=text/x-python;
  Actions=Edit;

  [Desktop Action Edit]
  Exec=/home/virtu/.local/bin/thonny %F
  Name=Edit with Thonny

Logout -- Login

Select Activities, type thonny, right click on thonny 'add to favorites'

  $ echo $PATH
  /home/virtu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:
  /usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

  $ touch hello.py
  $ ed hello.py
  a
  from vpython import *
  sphere()
  .
  w
  31
  q

  $ thonny hello.py
    Tools -> Manage Packages (wait ~1min)
    <INSTALL>
    pip
    setuptools
    wheel

  >>> import pip
  >>> pip.main(['install','vpython'])

Press green "Play" button (I>). Enjoy.

Bonus. Christmas tree.

  from vpython import *

  box(pos=vector(0,-8,0), width=8, length=2, height=1, color=color.magenta)
  box(pos=vector(0,-8,0), width=2, length=8, height=1, color=color.magenta)
  cylinder(pos=vector(0,-8,0), axis=vector(0,5,0), radius=1,color=color.orange)
  cone(pos=vector(0,-3,0), axis=vector(0,5,0), radius=7,color=color.green)
  cone(pos=vector(0,0,0), axis=vector(0,5,0), radius=5,color=color.green)
  cone(pos=vector(0,+3,0), axis=vector(0,5,0), radius=3,color=color.green)
  sphere(pos=vector(0,9,0), color=color.blue)

