Skip to content

Instantly share code, notes, and snippets.

@renzon
Created June 24, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renzon/fc997e9ffe0697bfc53fbe3e5b13eb8e to your computer and use it in GitHub Desktop.
Save renzon/fc997e9ffe0697bfc53fbe3e5b13eb8e to your computer and use it in GitHub Desktop.
Conc lines in file accordingly to condition
with open('seu_arquivo.txt', 'r', encoding='utf-8') as file:
new_line=[]
for line in file:
new_line.append(line)
if not # Aqui vai sua condiçao para concatenar com a(s) outra(s) linha(s):
print(''.join(new_line))
new_line=[]
if new_line:
print(''.join(new_line))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment