, .
-, - :
class CharGrid(object):
def __init__(self, text):
self.lines = text.split('\n')
def __getitem__(self, pos):
try:
col, row = pos
except (TypeError, ValueError):
raise KeyError('%r not a 2-tuple' % (pos,))
if row >= len(self.lines):
return ' '
line = self.lines[row]
if col >= len(line):
return ' '
return line[col]
2D-:
grid = CharGrid("""Creating a No-Conversion Job
>>-onpladm create job--job--+--------------+-- -n--------------->
'- -p--project-'
>-- -d--device-- -D--database-- -t--table----------------------->
.---------------------------------------------------------------------.
V |
>----+-----------------------------------------------------------------+-+-><
| (1) |
'-+-------------+--+-------------+--| Setting the Run Mode |------'
'- -S--server-' '- -T--target-'
""")
print ''.join((grid[0,0], grid[1,0], grid[2,0]))
print ''.join((grid[0,2], grid[1,2]))
()
Cre
>>
2D- 1D- :
... .. .
1D- , .