Advertisement
DomMisterSoja

codigo do prof

Sep 13th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. arquivo=open('vitor.pgm','r')
  2. geral=[]
  3. geral1=[]
  4. j=0
  5.  
  6. L1 = arquivo.readline()
  7. L2 = arquivo.readline()
  8. L3 = arquivo.readline()
  9.  
  10. linhas = []
  11. for i in arquivo:
  12.     #i = i.split(' ')
  13.     #i.reverse()
  14.     #linhas =  linhas + [ ' '.join(i) ]
  15.     linhas = [i] + linhas
  16. arquivo.close()
  17.  
  18.  
  19. arquivo2 = open('vitor2.pgm','w')
  20. arquivo2.write(L1)
  21. arquivo2.write(L2)
  22. arquivo2.write(L3)
  23.  
  24. arquivo2.writelines(linhas)
  25.  
  26. arquivo2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement