mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-30 05:46:31 -04:00
Former-commit-id: 207f3b35f60accf85eecbd03e1fd12d914478388 Former-commit-id: 61ea79b06c1af0c70fd7cb3d1b4a6696944ca9fe
17 lines
541 B
Python
Executable File
17 lines
541 B
Python
Executable File
#!/usr/bin/env python3
|
|
from os import listdir
|
|
|
|
# loop through all Python files in the working directory
|
|
for filename in listdir('working'):
|
|
if filename.endswith('.py'):
|
|
filepath = 'working/' + filename
|
|
# read input file
|
|
with open(filepath, 'r') as file:
|
|
new_file = []
|
|
for line in file:
|
|
# remove blank lines
|
|
if line != '\n':
|
|
new_file.append(line)
|
|
# write the updated file contents
|
|
open(filepath, 'w').writelines(new_file)
|