Created
May 1, 2016 20:59
-
-
Save FGFW/6ed5fa4e4eb7e8dc2cd53e3a766184b4 to your computer and use it in GitHub Desktop.
python文本内容居中显示.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| python文本内容居中显示.py | |
| http://bbs.bathome.net/thread-1289-1-1.html | |
| 2016年5月2日 04:51:33 codegay | |
| """ | |
| with open("a.txt") as f: | |
| txt=[r.strip() for r in f] | |
| w=max([len(r) for r in txt])+10 | |
| [print(r.center(w)) for r in txt] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment