Tkinter Tk a Python graphics, tutorial

  Python is available on all operating systems.
  The examples presented here have been run on Linux,
  ubuntu, and Windows 10. Not every computer has
  Python installed, and may not have some Python
  packages installed. Installation is covered below.

  (My files for python3 have extension .py3, you can use .py )

Learn from sequence of Tk graphics examples

  w0tk.py3 hello_world  source code
  
  

  w1tk.py3 second example, source code
  
  
  
  w2tk.py3 third example, source code

  w2tk_py3.out  print output

  

  w3tk.py3 third example, source code
  
  

  w4tk.py3 menu example, source code
  
  

  w1tkxy.py3 extended, source code
  
  
  
  color_tk.py3 color button source code
  
  color_tk_py3.out color name printout
  
  

  colorw.py3 plotting color source code
  
  

  arc.py3 arc, oval, poly source code
  
  

Installing Python and packages on Linux and Windows

  I happen to use Ubuntu Linux and Windows 10 and MAC OSX.
  Every operating system has Python available for installation.
  The Python packages for graphics, math, etc are installed
  using  pip .

  Use your browser, search for
  download python3 compiler
  download python3 tkinter
  download python3 numpy
  (follow download and install instructions for your operating system)

  For Ubuntu  after you have it up to date
  sudo apt update
  sudo apt upgrade
  sudo apt install python3-venv
  sudo apt install python3-pip
  sudo apt install python3-tk
  sudo apt install python3-numpy

  optional, other graphics and development
  sudo apt install python3-pyqt4
  sudo apt install python3-pyqt5
  sudo apt install -y build-essential
  sudo apt install -y libssl-dev
  sudo apt install -y libffi-dev
  sudo apt install -y python3-dev

  pip install numpy  # rather the sudo apt above may work
  same for other python packages you may want.
  Some of the   sudo apt   may say already installed.
  

python language examples

  exp1.py3 first example, getting output
  exp1_py3.out results from execution
  exp3.py3 list, tuples, range, arrays
  exp3_py3.out results from execution
  exp4.py3  loops, iteration statements
  exp4_py3.out results from execution
  exp5.py3  if then else statements
  exp5_py3.out results from execution
  exp6.py3  functions and procedures
  exp6_py3.out results from execution
  exp7.py3  read and write files
  exp7_py3.out results from execution
  exp8.py3  more functions
  exp8_py3.out results from execution

  Last updated 7/23/2020