- 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------- | |
# Name: module1 | |
# Purpose: | |
# | |
# Author: reevesj | |
# | |
# Created: 07/05/2011 | |
# Copyright: (c) reevesj 2011 | |
# Licence: <your licence> | |
#------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
really not minimal, taken from coding club bk | |
calculator | |
digits 0-9 | |
ops add, subtract, multiply and divide | |
brackets and clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Mouse Handling using Tkinter | |
A minimal mouse handling script, clearly using tkinter. Clumsily importing * | |
```python | |
from tkinter import * | |
#Globals | |
lastx, lasty = 0, 0 |
- presentation - https://www.dropbox.com/s/5cmd1dcxio91g16/9am%20week%201.pptx
- my working example - http://jsfiddle.net/bjGwu/ - forked at http://jsfiddle.net/v05r938r/
- worksheet = https://gist.github.com/daniellevass/a73006fa1a70f65d4312 = https://gist.github.com/JohnReeves/c4234b595287f03868e9
- https://www.google.com/events/io/experiment
- 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
OlderNewer