On 11/19/2015 12:17 PM, Patrick Hess wrote:
> ryguy7272 wrote:
>> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
>> [...]
>> It doesn't seem like the '\n' is doing anything useful. All the text is
>> jumbled together.
>> [...]
>> I finally got it working. It's like this:
>
ryguy7272 wrote:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> [...]
> It doesn't seem like the '\n' is doing anything useful. All the text is
> jumbled together.
> [...]
> I finally got it working. It's like this:
> "\r\n"
The better solution would be to open text f
ryguy7272 writes:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
Remove the "b" from this line. This is causing it to omit the
platform-specific translation of "\n", which means some Windows
applications will not recognize the line endings.
--
https://mail.python.org/ma
On Wed, 18 Nov 2015 09:40:58 -0800, ryguy7272 wrote:
>
> It doesn't seem like the '\n' is doing anything useful. All the text is
> jumbled together. When I open the file in Excel, or Notepad++, it is
> easy to read. However, when I open it in as a regular text file,
> everything is jumbled toge
On Wednesday, November 18, 2015 at 12:41:19 PM UTC-5, ryguy7272 wrote:
> On Wednesday, November 18, 2015 at 12:21:47 PM UTC-5, Denis McMahon wrote:
> > On Wed, 18 Nov 2015 08:37:47 -0800, ryguy7272 wrote:
> >
> > > I'm trying the script below...
> >
> > The problem isn't that you're over-writing
On Wednesday, November 18, 2015 at 12:21:47 PM UTC-5, Denis McMahon wrote:
> On Wed, 18 Nov 2015 08:37:47 -0800, ryguy7272 wrote:
>
> > I'm trying the script below...
>
> The problem isn't that you're over-writing the lines (although it may
> seem that way to you), the problem is that you're ove
On Wed, 18 Nov 2015 08:37:47 -0800, ryguy7272 wrote:
> I'm trying the script below...
The problem isn't that you're over-writing the lines (although it may
seem that way to you), the problem is that you're overwriting the whole
file every time you write a link to it. This is because you open an
On Wednesday, November 18, 2015 at 12:04:16 PM UTC-5, ryguy7272 wrote:
> On Wednesday, November 18, 2015 at 11:58:17 AM UTC-5, Chris Angelico wrote:
> > On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 <> wrote:
> > > text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt",
> > > "wb")
> >
On Wednesday, November 18, 2015 at 11:58:17 AM UTC-5, Chris Angelico wrote:
> On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 wrote:
> > text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> > z = str(link)
> > text_file.write(z + "\n")
> > text_file.writ
On Thu, Nov 19, 2015 at 3:37 AM, ryguy7272 wrote:
> text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb")
> z = str(link)
> text_file.write(z + "\n")
> text_file.write("\n")
> text_file.close()
You're opening the file every time you go through
I'm trying the script below, and it simple writes the last line to a text file.
I want to add a '\n' after each line is written, so I don't overwrite all the
lines.
from bs4 import BeautifulSoup
import urllib2
var_file = urllib2.urlopen("http://www.imdb.com/chart/top";)
var_html = var_file.
11 matches
Mail list logo