PYTHON TIPS

Visual Python workaround:

  1. install Thonny 4 from thonny.org.
  2. Add to a system path: <path_to_exe>\Thonny\, <path_to_exe>\Thonny\Scripts\ folders (Settings, find ENV environment variables, to discover <path_to_exe> open Thonny shortcat properties or just walk with File Explorer into the folder where Thonny.exe is placed, then click in location edit box and copy desired path to a clipboard).
  3. In Powershell install/upgrade packages*1:
    pip3 install --upgrade pip
    pip3 install --upgrade vpython txaio twisted
    
  4. Run test example:
    1. open Thonny
    2. paste example below,
    3. select all,
    4. edit -> deindent selected lines once
    5. to run for the first time open firewall port as asked
    6. in opened browser window:
      • middle mouse button + move mouse to go closer or back,
      • right mouse button + move mouse to rotate view)
     import txaio
    
     txaio.use_asyncio()
    
     from random import seed, randint
     from vpython import *
    
     palette=[ color.red, color.orange, color.yellow, \
               color.green, color.cyan, color.blue, \
               color.magenta ]
    
     seed()
     box( pos=vector(0, 0, -1.2), color=vector(.4, .6, .4), \
          width=0.1, height=13, length=13)
     sphere( color=color.orange, pos=vector(0, 4, 0))
    
     for y in range(1, 5):
         for x in range(0, y+1):
             sphere(color=palette[ randint(0,6)], \
                    pos=vector(-y+2*x,4-1.7*y,0))
    

Prints this:

-- *1) https://stackoverflow.com/questions/34157314/autobahn-websocket-issue-while-running-with-twistd-using-tac-file

*2) xdg-settings set default-web-browser firefox-esr.desktop