Advertisement
kylemsguy

Removing linebrks from passage-Typos and stupidity included

Dec 12th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.97 KB | None | 0 0
  1. Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
  2. Type "copyright", "credits" or "license()" for more information.
  3. >>> import os
  4. >>> os.chdir("C:\\Users\\Kyle\\Desktop")
  5. >>> a = open("asdf.txt","r")
  6. >>> a.readlines()
  7. ['No.\n', 'Coketown did not come out of its own furnaces, in all respects like\n', 'gold that had stood the fire. First, the perplexing mystery of the\n', 'place was, Who belonged to the eighteen denominations? Because,\n', 'whoever did, the labouring people did not. It was very strange to\n', 'walk through the streets on a Sunday morning, and note how few\n', 'of them the barbarous jangling of bells that was driving the sick\n', 'and nervous mad, called away from their own quarter, from their\n', 'own close rooms, from the corners of their own streets, where they\n', 'lounged listlessly, gazing at all the church and chapel going, as at a\n', 'thing with which they had no manner of concern. Nor was it\n', 'merely the stranger who noticed this, because there was a native\n', 'organization in Coketown itself, whose members were to be heard\n', 'of in the House of Commons every session, indignantly petitioning\n', 'for acts of parliament that should make these people religious by\n', 'main force. Then, came the Teetotal Society, who complained that\n', 'these same people would get drunk, and showed in tabular\n', 'statements that they did get drunk, and proved at tea parties that\n', 'no inducement, human or Divine (except a medal), would induce\n', 'them to forego their custom of getting drunk. Then, came the\n', 'chemist and druggist, with other tabular statements, showing that\n', 'when they didn\x92t get drunk, they took opium. Then, came the\n', 'experienced chaplain of the jail, with more tabular statements,\n', 'outdoing all the previous tabular statements, and showing that the\n', 'same people would resort to low haunts, hidden from the public\n', 'eye, where they heard low singing and saw low dancing, and\n', 'mayhap joined in it; and where A. B., aged twenty-four next\n', 'birthday, and  committed for eighteen months\x92 solitary, had\n', 'himself said (not that he had ever shown himself particularly\n', 'worthy of belief) his ruin began, as he was perfectly sure and\n', 'confident that otherwise he would have been a tip-top moral\n', 'specimen.']
  8. >>> a.readlines().split("\n")
  9.  
  10. Traceback (most recent call last):
  11.   File "<pyshell#4>", line 1, in <module>
  12.     a.readlines().split("\n")
  13. AttributeError: 'list' object has no attribute 'split'
  14. >>> b = a.readlines()
  15. >>> ' '.join(b)
  16. ''
  17. >>> b
  18. []
  19. >>> a.readlines()
  20. []
  21. >>> a.top()
  22.  
  23. Traceback (most recent call last):
  24.   File "<pyshell#9>", line 1, in <module>
  25.     a.top()
  26. AttributeError: 'file' object has no attribute 'top'
  27. >>> a.close
  28. <built-in method close of file object at 0x02A26128>
  29. >>> a.close()
  30. >>> a = open("asdf.txt",'r')
  31. >>> b = a.readlines()
  32. >>> b
  33. ['No.\n', 'Coketown did not come out of its own furnaces, in all respects like\n', 'gold that had stood the fire. First, the perplexing mystery of the\n', 'place was, Who belonged to the eighteen denominations? Because,\n', 'whoever did, the labouring people did not. It was very strange to\n', 'walk through the streets on a Sunday morning, and note how few\n', 'of them the barbarous jangling of bells that was driving the sick\n', 'and nervous mad, called away from their own quarter, from their\n', 'own close rooms, from the corners of their own streets, where they\n', 'lounged listlessly, gazing at all the church and chapel going, as at a\n', 'thing with which they had no manner of concern. Nor was it\n', 'merely the stranger who noticed this, because there was a native\n', 'organization in Coketown itself, whose members were to be heard\n', 'of in the House of Commons every session, indignantly petitioning\n', 'for acts of parliament that should make these people religious by\n', 'main force. Then, came the Teetotal Society, who complained that\n', 'these same people would get drunk, and showed in tabular\n', 'statements that they did get drunk, and proved at tea parties that\n', 'no inducement, human or Divine (except a medal), would induce\n', 'them to forego their custom of getting drunk. Then, came the\n', 'chemist and druggist, with other tabular statements, showing that\n', 'when they didn\x92t get drunk, they took opium. Then, came the\n', 'experienced chaplain of the jail, with more tabular statements,\n', 'outdoing all the previous tabular statements, and showing that the\n', 'same people would resort to low haunts, hidden from the public\n', 'eye, where they heard low singing and saw low dancing, and\n', 'mayhap joined in it; and where A. B., aged twenty-four next\n', 'birthday, and  committed for eighteen months\x92 solitary, had\n', 'himself said (not that he had ever shown himself particularly\n', 'worthy of belief) his ruin began, as he was perfectly sure and\n', 'confident that otherwise he would have been a tip-top moral\n', 'specimen.']
  34. >>> ' '.join('b')
  35. 'b'
  36. >>> ' '.join(b)
  37. 'No.\n Coketown did not come out of its own furnaces, in all respects like\n gold that had stood the fire. First, the perplexing mystery of the\n place was, Who belonged to the eighteen denominations? Because,\n whoever did, the labouring people did not. It was very strange to\n walk through the streets on a Sunday morning, and note how few\n of them the barbarous jangling of bells that was driving the sick\n and nervous mad, called away from their own quarter, from their\n own close rooms, from the corners of their own streets, where they\n lounged listlessly, gazing at all the church and chapel going, as at a\n thing with which they had no manner of concern. Nor was it\n merely the stranger who noticed this, because there was a native\n organization in Coketown itself, whose members were to be heard\n of in the House of Commons every session, indignantly petitioning\n for acts of parliament that should make these people religious by\n main force. Then, came the Teetotal Society, who complained that\n these same people would get drunk, and showed in tabular\n statements that they did get drunk, and proved at tea parties that\n no inducement, human or Divine (except a medal), would induce\n them to forego their custom of getting drunk. Then, came the\n chemist and druggist, with other tabular statements, showing that\n when they didn\x92t get drunk, they took opium. Then, came the\n experienced chaplain of the jail, with more tabular statements,\n outdoing all the previous tabular statements, and showing that the\n same people would resort to low haunts, hidden from the public\n eye, where they heard low singing and saw low dancing, and\n mayhap joined in it; and where A. B., aged twenty-four next\n birthday, and  committed for eighteen months\x92 solitary, had\n himself said (not that he had ever shown himself particularly\n worthy of belief) his ruin began, as he was perfectly sure and\n confident that otherwise he would have been a tip-top moral\n specimen.'
  38. >>> c = ' '.join(b)
  39. >>> c.split('\n')
  40. ['No.', ' Coketown did not come out of its own furnaces, in all respects like', ' gold that had stood the fire. First, the perplexing mystery of the', ' place was, Who belonged to the eighteen denominations? Because,', ' whoever did, the labouring people did not. It was very strange to', ' walk through the streets on a Sunday morning, and note how few', ' of them the barbarous jangling of bells that was driving the sick', ' and nervous mad, called away from their own quarter, from their', ' own close rooms, from the corners of their own streets, where they', ' lounged listlessly, gazing at all the church and chapel going, as at a', ' thing with which they had no manner of concern. Nor was it', ' merely the stranger who noticed this, because there was a native', ' organization in Coketown itself, whose members were to be heard', ' of in the House of Commons every session, indignantly petitioning', ' for acts of parliament that should make these people religious by', ' main force. Then, came the Teetotal Society, who complained that', ' these same people would get drunk, and showed in tabular', ' statements that they did get drunk, and proved at tea parties that', ' no inducement, human or Divine (except a medal), would induce', ' them to forego their custom of getting drunk. Then, came the', ' chemist and druggist, with other tabular statements, showing that', ' when they didn\x92t get drunk, they took opium. Then, came the', ' experienced chaplain of the jail, with more tabular statements,', ' outdoing all the previous tabular statements, and showing that the', ' same people would resort to low haunts, hidden from the public', ' eye, where they heard low singing and saw low dancing, and', ' mayhap joined in it; and where A. B., aged twenty-four next', ' birthday, and  committed for eighteen months\x92 solitary, had', ' himself said (not that he had ever shown himself particularly', ' worthy of belief) his ruin began, as he was perfectly sure and', ' confident that otherwise he would have been a tip-top moral', ' specimen.']
  41. >>> d = c.split('\n')
  42. >>> a.close
  43. <built-in method close of file object at 0x02A26180>
  44. >>> a.close()
  45. >>> d
  46. ['No.', ' Coketown did not come out of its own furnaces, in all respects like', ' gold that had stood the fire. First, the perplexing mystery of the', ' place was, Who belonged to the eighteen denominations? Because,', ' whoever did, the labouring people did not. It was very strange to', ' walk through the streets on a Sunday morning, and note how few', ' of them the barbarous jangling of bells that was driving the sick', ' and nervous mad, called away from their own quarter, from their', ' own close rooms, from the corners of their own streets, where they', ' lounged listlessly, gazing at all the church and chapel going, as at a', ' thing with which they had no manner of concern. Nor was it', ' merely the stranger who noticed this, because there was a native', ' organization in Coketown itself, whose members were to be heard', ' of in the House of Commons every session, indignantly petitioning', ' for acts of parliament that should make these people religious by', ' main force. Then, came the Teetotal Society, who complained that', ' these same people would get drunk, and showed in tabular', ' statements that they did get drunk, and proved at tea parties that', ' no inducement, human or Divine (except a medal), would induce', ' them to forego their custom of getting drunk. Then, came the', ' chemist and druggist, with other tabular statements, showing that', ' when they didn\x92t get drunk, they took opium. Then, came the', ' experienced chaplain of the jail, with more tabular statements,', ' outdoing all the previous tabular statements, and showing that the', ' same people would resort to low haunts, hidden from the public', ' eye, where they heard low singing and saw low dancing, and', ' mayhap joined in it; and where A. B., aged twenty-four next', ' birthday, and  committed for eighteen months\x92 solitary, had', ' himself said (not that he had ever shown himself particularly', ' worthy of belief) his ruin began, as he was perfectly sure and', ' confident that otherwise he would have been a tip-top moral', ' specimen.']
  47. >>> ''.join(d)
  48. 'No. Coketown did not come out of its own furnaces, in all respects like gold that had stood the fire. First, the perplexing mystery of the place was, Who belonged to the eighteen denominations? Because, whoever did, the labouring people did not. It was very strange to walk through the streets on a Sunday morning, and note how few of them the barbarous jangling of bells that was driving the sick and nervous mad, called away from their own quarter, from their own close rooms, from the corners of their own streets, where they lounged listlessly, gazing at all the church and chapel going, as at a thing with which they had no manner of concern. Nor was it merely the stranger who noticed this, because there was a native organization in Coketown itself, whose members were to be heard of in the House of Commons every session, indignantly petitioning for acts of parliament that should make these people religious by main force. Then, came the Teetotal Society, who complained that these same people would get drunk, and showed in tabular statements that they did get drunk, and proved at tea parties that no inducement, human or Divine (except a medal), would induce them to forego their custom of getting drunk. Then, came the chemist and druggist, with other tabular statements, showing that when they didn\x92t get drunk, they took opium. Then, came the experienced chaplain of the jail, with more tabular statements, outdoing all the previous tabular statements, and showing that the same people would resort to low haunts, hidden from the public eye, where they heard low singing and saw low dancing, and mayhap joined in it; and where A. B., aged twenty-four next birthday, and  committed for eighteen months\x92 solitary, had himself said (not that he had ever shown himself particularly worthy of belief) his ruin began, as he was perfectly sure and confident that otherwise he would have been a tip-top moral specimen.'
  49. >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement