40
|
1 #!/usr/bin/env python
|
|
2
|
42
|
3 """
|
|
4 make a string one line
|
|
5 """
|
|
6
|
|
7 import sys
|
|
8
|
40
|
9 def onelineit(string):
|
42
|
10 """make a string one line"""
|
|
11
|
40
|
12 string = string.split('\n')
|
|
13 string = [ i.strip() or '\n' for i in string ]
|
|
14 string = ' '.join(string)
|
|
15 string = string.split('\n')
|
|
16 string = [ i.strip() for i in string if i.strip() ]
|
|
17
|
|
18 return '\n\n'.join(string)
|
|
19
|
42
|
20 def main(args=sys.argv[1:]):
|
|
21 """CLI"""
|
|
22 print (onelineit(sys.stdin.read()))
|
|
23
|
40
|
24 if __name__ == '__main__':
|
42
|
25 main()
|