Changes

Jump to navigation Jump to search
m
Line 38: Line 38:  
[[Image:TA-dotted-line.png]]
 
[[Image:TA-dotted-line.png]]
   −
def myblock(tw, line_length):
+
<pre>
 +
def myblock(tw, line_length):
 
     ''' Draw a dotted line of length line_length. '''
 
     ''' Draw a dotted line of length line_length. '''
 
     try:  # make sure line_length is a number
 
     try:  # make sure line_length is a number
Line 58: Line 59:  
         tw.canvas.forward(line_length)
 
         tw.canvas.forward(line_length)
 
     return
 
     return
 
+
</pre>
 
You can pass a list of up to three arguments to tamyblock.py as in the example below that converts the input to an rgb value.
 
You can pass a list of up to three arguments to tamyblock.py as in the example below that converts the input to an rgb value.
    
[[Image:TA-rgb.png]]
 
[[Image:TA-rgb.png]]
   −
def myblock(tw, rgb_array):
+
<pre>
 +
def myblock(tw, rgb_array):
 
     ''' Set rgb color from values '''
 
     ''' Set rgb color from values '''
 
     tw.canvas.fgrgb = [(int(rgb_array[0]) % 256),
 
     tw.canvas.fgrgb = [(int(rgb_array[0]) % 256),
 
                       (int(rgb_array[1]) % 256),
 
                       (int(rgb_array[1]) % 256),
 
                       (int(rgb_array[2]) % 256)]
 
                       (int(rgb_array[2]) % 256)]
 
+
</pre>
    
  def myblock(tw, x):
 
  def myblock(tw, x):

Navigation menu