|
|
@ -36,6 +36,7 @@ def eval(cmds):
|
|
|
|
global text
|
|
|
|
global text
|
|
|
|
global line_number
|
|
|
|
global line_number
|
|
|
|
global last_index
|
|
|
|
global last_index
|
|
|
|
|
|
|
|
global pattern
|
|
|
|
|
|
|
|
|
|
|
|
for cmd in cmds:
|
|
|
|
for cmd in cmds:
|
|
|
|
if cmd == []:
|
|
|
|
if cmd == []:
|
|
|
@ -75,6 +76,11 @@ def eval(cmds):
|
|
|
|
pattern = text[0:line_number + 1]
|
|
|
|
pattern = text[0:line_number + 1]
|
|
|
|
print('\n'.join(pattern))
|
|
|
|
print('\n'.join(pattern))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif cmd[0] == 'save':
|
|
|
|
|
|
|
|
pattern_file = open('output/patternfile.txt', 'w')
|
|
|
|
|
|
|
|
pattern_file.write('\n'.join(pattern))
|
|
|
|
|
|
|
|
pattern_file.close()
|
|
|
|
|
|
|
|
print('Your pattern has been saved in the output folder.')
|
|
|
|
|
|
|
|
|
|
|
|
elif cmd[0] == 'quit':
|
|
|
|
elif cmd[0] == 'quit':
|
|
|
|
print('Come back soon!')
|
|
|
|
print('Come back soon!')
|
|
|
|