mirror of
https://github.com/triqs/dft_tools
synced 2024-10-31 19:23:45 +01:00
f2c7d449cc
for earlier commits, see TRIQS0.x repository.
35 lines
814 B
Python
35 lines
814 B
Python
import sys
|
|
from code import InteractiveInterpreter
|
|
|
|
|
|
def main():
|
|
"""
|
|
Print lines of input along with output.
|
|
"""
|
|
source_lines = (line.rstrip() for line in sys.stdin)
|
|
console = InteractiveInterpreter()
|
|
source = ''
|
|
try:
|
|
while True:
|
|
source = source_lines.next()
|
|
print '>>>', source
|
|
more = console.runsource(source)
|
|
while more:
|
|
next_line = source_lines.next()
|
|
print '...', next_line
|
|
source += '\n' + next_line
|
|
more = console.runsource(source)
|
|
except StopIteration:
|
|
if more:
|
|
print '... '
|
|
more = console.runsource(source + '\n')
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|
|
|
|
|
|
# vim: set expandtab shiftwidth=4 softtabstop=4 :
|
|
|