Skip to content

Instantly share code, notes, and snippets.

View JohnReeves's full-sized avatar

John Reeves JohnReeves

View GitHub Profile
```python
from tkinter import *
window=Tk()
canvas=Canvas(height=400,width=600,bg="black")
#canvas.create_line(x0,y0,x1,y1)
canvas.create_line(0,0,600,400,fill="blue",width=200)
canvas.create_line(600,0,0,400,fill="blue",width=200)
```python
#import libraries
from tkinter import *
from random import randint
c_width,c_height=600,600
col="black"
colours = ["red", "orange", "yellow", "green", "blue", "purple"]
```python
class Shape:
def __init__(self, dim1, dim2):
self.dim1=dim1
self.dim1=dim2
def area(self):
return self.dim1*self.dim2
def perimeter(self):
return 2*(self.dim1+self.dim2)
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: reevesj
#
# Created: 07/05/2011
# Copyright: (c) reevesj 2011
# Licence: <your licence>
#-------------------------------------------------------------------------------
"""
really not minimal, taken from coding club bk
calculator
digits 0-9
ops add, subtract, multiply and divide
brackets and clear
# import the libraries
from tkinter import *
from random import *
# Step 1: create the top level Tk object
window=Tk()
c_wd,c_ht=800,600
#Mouse Handling using Tkinter
A minimal mouse handling script, clearly using tkinter. Clumsily importing *
```python
from tkinter import *
#Globals
lastx, lasty = 0, 0

Space Worksheet

alt text

Task 1 - Create your Sun

  • open repl.it in a new tab (preferably using Google Chrome)
  • create a new html/javascript/css project
  • add these lines in the body of the HTML file (index.html)

Space Worksheet 2

alt text

Task 1 - Setup

  • Either find your repl.it from last week (you need at least 1 planet to start this worksheet)
  • Or use my JSFiddle (please open in a new tab in Google Chrome)

Enable jQuery