import time

#--- selection of import based on the package ---
''' 1. with RPi.GPIO'''
#import RPi.GPIO as GPIO
''' 2. without RPi.GPIO'''
from dummyGPIO import CDummyGPIO
GPIO = CDummyGPIO()
#-----------------

# TODO: 0m > dummyGPIO

GPIO.setmode(GPIO.BOARD)

#-------------------
# Pin# of RPi2 (changes according to connection)
pinnum=[3, 5, 7, 11, 13, 15, 19, 21]
#-------------------
# onoff bit (7segment led > a..g)
onoff=[ 
[True,  True, True, True,  True,      True,  True,  False ], # disp 0
[False, True, True, False, False,     False, False, False ], # disp 1
[True,  True, False, True,  True,      False,  True, False ], # disp 2
[True,  True, True,  True, False,      False, True, False], # disp 3
[False, True, True, False, False,      False, True,  False ], # disp 4
[True, False, True, True, False,       True,  True, False], # disp 5
[True, False, True, True,  True,       True, True, False], # disp 6
[True, True, True, False, False,       True, False, False], # disp 7
[True, True, True,  True,  True,       True, True, False], # disp 8
[True, True, True,  True,  False,       True, True, False], # disp 9
[False, False, False, False, False,     False, False, True], # disp .
]
# TODO: 0z > add out of range display
#-------------------
codes=[ 3, 1, 4, 1]


for idx in range(0, len(pinnum)):
	GPIO.setup(pinnum[idx], GPIO.OUT)

print "-------"

numsegs=8 # a..g

for digit in range(0, 4): # TODO: 1> size of
	code = codes[digit]
	print code
	for idx in range(0, numsegs):
		print pinnum[idx], onoff[code][idx]
	time.sleep(1.0)
@@ -1272,16 +1272,26 @@
  4, 1%5D%0A%0A
+# 1. setup
 %0Afor idx
@@ -1357,42 +1357,143 @@
 T)%0A%0A
-print %22-------%22%0A%0Anumsegs=8 # a..g%0A
+# 2. 7seg LED on%0Afor idx in range(0, len(pinnum)): # a..g%0A%09GPIO.setup(pinnum%5Bidx%5D, onoff%5B3%5D%5Bidx%5D)%0Atime.sleep(5.0)%0A%0Aprint %22-------%22%0A%0A'''
 %0Afor
@@ -1592,17 +1592,28 @@
 (0, 
-numsegs):
+len(pinnum)): # a..g
 %0A%09%09p
@@ -1663,8 +1663,12 @@
 eep(1.0)
+%0A'''

test dips 3