Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. List=[[1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11, 12, 15]]
  2.  
  3. [1, 2, 3]
  4. [4, 5, 6, 7]
  5. [8, 9, 10, 11, 12, 15]
  6.  
  7. 1, 2, 3
  8. 4, 5, 6, 7
  9. 8, 9, 10, 11, 12, 15
  10.  
  11. file.write(','.join(map(repr, List[i]))
  12.  
  13. file.write(str(List[i]))
  14.  
  15. '[' + ', '.join(map(repr, self)) + ']'
  16.  
  17. ','.join(map(repr, self))
  18.  
  19. import csv
  20. with open('/tmp/myfile.txt', 'w') as f:
  21. csv_writer = csv.writer(f)
  22. csv_writer.writerows(List)
  23.  
  24. from __future__ import print_function # ignore if on py 3.x
  25.  
  26. for line in List:
  27. print(*line, sep=',', file=file)
  28.  
  29. print 'n'.join(','.join(map(str, x)) for x in List)
  30.  
  31. print(fd.read().split('n')[:1])
  32.  
  33. ['(information)']
  34.  
  35. fd = open('examplefile.txt', 'r+')
  36. print(fd.read().split('n')[1-1])
  37. fd = open('examplefile.txt', 'r+')
  38. print(file2 = fd.read().split('n')[2-3])
  39.  
  40. (information1)
  41. (information2)
  42.  
  43. fd = open('examplefile.txt', 'r+')
  44. print(fd.read().split('n')[1-1])
  45. print(file2 = fd.read().split('n')[2-3])
  46.  
  47. (information1)
Add Comment
Please, Sign In to add comment