Skip to content

Commit 8522763

Browse files
author
Tom De Smedt
committed
Live coding example
1 parent 4bd54ec commit 8522763

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

examples/12-experimental/04-live1.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
# Add the upper directory (where the nodebox module is) to the search path.
22
import os, sys; sys.path.insert(0, os.path.join("..", ".."))
3-
<<<<<<< HEAD
43
import warnings
5-
=======
6-
>>>>>>> 2dde5a7eb4a0f379e8d2476487011bdacba7e165
74

85
from nodebox.graphics import *
96

107
# Live coding example.
118
# The actual drawing code is in 04-live2.py.
129
# This script starts the canvas and executes the commands from 04-live2.py.
13-
<<<<<<< HEAD
1410
# You can then edit and save the code there,
1511
# changes will be reflected automatically while the canvas keeps running.
16-
=======
17-
# You can then edit and save the code there, changes will be reflected automatically.
18-
>>>>>>> 2dde5a7eb4a0f379e8d2476487011bdacba7e165
1912

2013
SCRIPT = "04-live2.py"
2114
source = open(SCRIPT).read()
@@ -24,14 +17,10 @@
2417
def draw(canvas):
2518
global source
2619
global modified
27-
<<<<<<< HEAD
2820
try:
2921
exec(source)
3022
except Exception, e:
3123
warnings.warn(str(e), Warning)
32-
=======
33-
exec(source)
34-
>>>>>>> 2dde5a7eb4a0f379e8d2476487011bdacba7e165
3524
if os.path.getmtime(SCRIPT) > modified:
3625
source = open(SCRIPT).read()
3726
modified = os.path.getmtime(SCRIPT)
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
<<<<<<< HEAD
21
# Live coding example.
32
# See 04-live1.py.
43
# The commands below are read and executed in a canvas there.
54
# If you edit and save this file, changes are automatically reflected,
65
# while the canvas started in 04-live1.py keeps on running.
7-
=======
8-
# See 04-live1.py.
9-
# The commands below are read and executed in a canvas there.
10-
# If you edit and save this file, changes are automatically reflected.
11-
>>>>>>> 2dde5a7eb4a0f379e8d2476487011bdacba7e165
126

137
#canvas.clear()
148
for i in range(10):
@@ -17,8 +11,4 @@
1711
r = random(20) + 50
1812
fill(random(), 0.0, random(0.25), random(0.25))
1913
stroke(0, 0.2)
20-
<<<<<<< HEAD
21-
ellipse(x, y, random, r)
22-
=======
2314
ellipse(x, y, r, r)
24-
>>>>>>> 2dde5a7eb4a0f379e8d2476487011bdacba7e165

0 commit comments

Comments
 (0)