jgtrosh

boxes.py

Aug 4th, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import os
  2. text = 'this is text\nsomething\nsomething else\nsomething or other'
  3. lines = text.split("\n")
  4. maxlen = max(len(line) for line in lines)
  5. print ' '+'-'*maxlen
  6. for line in lines:
  7.     print '|'+line+' '*(maxlen-len(line))+'|'
  8. print ' '+'-'*maxlen
  9. if 'win' in os.sys.platform:
  10.     os.system('PAUSE')
Advertisement
Add Comment
Please, Sign In to add comment