Advertisement
cd62131

.txt to .sh

Mar 17th, 2019
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. from pathlib import Path
  2. for p in Path('.').glob('*.txt'):
  3.     if not p.is_file():
  4.         next
  5.     with p.with_suffix('.sh').open(mode='w') as w:
  6.         print(p.stem, file=w)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement