On 2010-12-29 10:54, Tommy Kaas wrote:
It works fine but besides # I also get spaces between the columns in the
text file. How do I avoid that?
You could use the new print-function and the sep keyword argument, e.g.:
from __future__ import print_function
f = open("filename", "w")
print("1", "
Peter Otten, 29.12.2010 13:45:
File "/usr/lib/pymodules/python2.6/BeautifulSoup.py", line 430, in encode
return self.decode().encode(encoding)
Wow, that's evil.
Stefan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscrip
Tommy Kaas wrote:
> With Stevens help about writing and Peters help about import codecs - and
> when I used \r\n instead of \r to give me new lines everything worked. I
> just thought that \n would be necessary? Thanks.
> Tommy
Newline handling varies across operating systems. If you are on Windo
On 01/-10/-28163 02:59 PM, Tommy Kaas wrote:
Steven D'Aprano wrote:
But in your case, the best way is not to use print at all. You are writing
to a
file -- write to the file directly, don't mess about with print. Untested:
f = open('tabeltest.txt', 'w')
url = 'http://www.kaasogmulvad.dk/unv/
on.org
> [mailto:tutor-bounces+tommy.kaas=kaasogmulvad...@python.org] På
> vegne af Peter Otten
> Sendt: 29. december 2010 11:46
> Til: tutor@python.org
> Emne: Re: [Tutor] scraping and saving in file
>
> Tommy Kaas wrote:
>
> > I’m trying to learn basic web scr
Tommy Kaas wrote:
> Steven D'Aprano wrote:
>> But in your case, the best way is not to use print at all. You are
>> writing
> to a
>> file -- write to the file directly, don't mess about with print.
>> Untested:
>>
>>
>> f = open('tabeltest.txt', 'w')
>> url = 'http://www.kaasogmulvad.dk/unv/pyt
Steven D'Aprano wrote:
> But in your case, the best way is not to use print at all. You are writing
to a
> file -- write to the file directly, don't mess about with print. Untested:
>
>
> f = open('tabeltest.txt', 'w')
> url = 'http://www.kaasogmulvad.dk/unv/python/tabeltest.htm'
> soup = Beautif
Tommy Kaas wrote:
> Im trying to learn basic web scraping and starting from scratch. Im
> using Activepython 2.6.6
> I have uploaded a simple table on my web page and try to scrape it and
> will save the result in a text file. I will separate the columns in the
> file with
> #.
> It works fin
Am 29.12.2010 10:54, schrieb Tommy Kaas:
Hi,
I’m trying to learn basic web scraping and starting from scratch. I’m
using Activepython 2.6.6
I have uploaded a simple table on my web page and try to scrape it and
will save the result in a text file. I will separate the columns in the
file with #.
Tommy Kaas wrote:
I have uploaded a simple table on my web page and try to scrape it and will
save the result in a text file. I will separate the columns in the file with
#.
It works fine but besides # I also get spaces between the columns in the
text file. How do I avoid that?
The print comm
Hi,
Im trying to learn basic web scraping and starting from scratch. Im using
Activepython 2.6.6
I have uploaded a simple table on my web page and try to scrape it and will
save the result in a text file. I will separate the columns in the file with
#.
It works fine but besides # I also get
11 matches
Mail list logo