On Fri, 4 Jun 2010 12:45:52 am Colin Talbert wrote:
> I thought when you did a for uline in input_file each single line
> would go into memory independently, not the entire file.
for line in file:
reads one line at a time, but file.read() tries to read everything in
one go. However, it should f
On 3 June 2010 21:02, Colin Talbert wrote:
> I couldn't find any example of it in use and wasn't having any luck getting
> it to work based on the documentation.
Good examples of the bz2 module can be found at [1].
greets
Sander
[1] http://www.doughellmann.com/PyMOTW/bz2/
gt; (970) 226-9425
> talbe...@usgs.gov
>
>
>
> From: Dave Angel To:
> Colin Talbert
> Cc: Steven D'Aprano , tutor@python.org Date: 06/03/2010
> 12:36 PM Subject: Re: [Tutor] parse text file
> --
>
>
>
> Colin Talbert wrote:
rt Collins Science Center
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526
(970) 226-9425
talbe...@usgs.gov
From:
Dave Angel
To:
Colin Talbert
Cc:
Steven D'Aprano , tutor@python.org
Date:
06/03/2010 12:36 PM
Subject:
Re: [Tutor] parse text file
Colin Talbert wrote:
>
> You are
Colin Talbert wrote:
You are so correct. I'd been trying numerous things to read in this file
and had deleted the code that I meant to put here and so wrote this from
memory incorrectly. The code that I wrote should have been:
import bz2
input_file = bz2.BZ2File(r'C:\temp\planet-latest.osm
"Colin Talbert" wrote
I thought when you did a for uline in input_file each single line
would go
into memory independently, not the entire file.
Thats true but your code snippet showed you using read()
which reads the whole file...
I'm pretty sure that this is not your code, because you ca
ogical Survey - Fort Collins Science Center
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526
(970) 226-9425
talbe...@usgs.gov
From:
Steven D'Aprano
To:
tutor@python.org
Date:
06/02/2010 03:42 PM
Subject:
Re: [Tutor] parse text file
Sent by:
tutor-bounces+talbertc=usgs@python.org
Hi
Hi Colin,
I'm taking the liberty of replying to your message back to the list, as
others hopefully may be able to make constructive comments. When
replying, please ensure that you reply to the tutor mailing list rather
than then individual.
On Thu, 3 Jun 2010 12:20:10 am Colin Talbert wrote:
Colin Talbert
GIS Specialist
US Geological Survey - Fort Collins Science Center
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526
(970) 226-9425
talbe...@usgs.gov
From: bob gailer
To: Colin Talbert
Cc: tutor@python.org
Date: 06/01/2010 04:43 PM
Subject: Re
On Wed, 2 Jun 2010 07:40:33 am Colin Talbert wrote:
> I am also experiencing this same problem. (Also on a OSM bz2
> file). It appears to be working but then partway through reading a
> file it simple ends. I did track down that file length is always
> 90 so it appears to be related
On 6/1/2010 5:40 PM, Colin Talbert wrote:
I am also experiencing this same problem. (Also on a OSM bz2
file). It appears to be working but then partway through reading a
file it simple ends. I did track down that file length is always
90 so it appears to be related to some sort
I am also experiencing this same problem. (Also on a OSM bz2
file). It appears to be working but then partway through reading a file
it simple ends. I did track down that file length is always 90 so it
appears to be related to some sort of buffer constraint.
Any other ideas?
im
On Tue, Feb 2, 2010 at 11:36 PM, Kent Johnson wrote:
> On Tue, Feb 2, 2010 at 4:56 PM, Norman Khine wrote:
>> On Tue, Feb 2, 2010 at 10:11 PM, Kent Johnson wrote:
>
>>> Try this version:
>>>
>>> data = file.read()
>>>
>>> get_records = re.compile(r"""openInfoWindowHtml\(.*?\ticon:
>>> myIcon\n""
On Tue, 2 Feb 2010 22:56:22 +0100
Norman Khine wrote:
> i am no expert, but there seems to be a bigger difference.
>
> with repr(), i get:
> Sat\\xe9re Maw\\xe9
>
> where as you get
>
> Sat\xc3\xa9re Maw\xc3\xa9
>
> repr()'s
> é == \\xe9
> whereas on your version
> é == \xc3\xa9
This is a ra
On Tue, Feb 2, 2010 at 4:56 PM, Norman Khine wrote:
> On Tue, Feb 2, 2010 at 10:11 PM, Kent Johnson wrote:
>> Try this version:
>>
>> data = file.read()
>>
>> get_records = re.compile(r"""openInfoWindowHtml\(.*?\ticon:
>> myIcon\n""", re.DOTALL).findall
>> get_titles = re.compile(r"""(.*)<\/stro
On Tue, Feb 2, 2010 at 10:11 PM, Kent Johnson wrote:
> On Tue, Feb 2, 2010 at 1:39 PM, Norman Khine wrote:
>> On Tue, Feb 2, 2010 at 4:19 PM, Kent Johnson wrote:
>>> On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine wrote:
On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson wrote:
> On Tue, Feb 2
On Tue, Feb 2, 2010 at 1:39 PM, Norman Khine wrote:
> On Tue, Feb 2, 2010 at 4:19 PM, Kent Johnson wrote:
>> On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine wrote:
>>> On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson wrote:
On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine wrote:
Why do you use
On Tue, Feb 2, 2010 at 4:19 PM, Kent Johnson wrote:
> On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine wrote:
>> On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson wrote:
>>> On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine wrote:
>>>
here are the changes:
import re
file=open('producers_g
On Tue, Feb 2, 2010 at 9:33 AM, Norman Khine wrote:
> On Tue, Feb 2, 2010 at 1:27 PM, Kent Johnson wrote:
>> On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine wrote:
>>
>>> here are the changes:
>>>
>>> import re
>>> file=open('producers_google_map_code.txt', 'r')
>>> data = repr( file.read().decode
hello,
thank you all for the advise, here is the updated version with the changes.
import re
file = open('producers_google_map_code.txt', 'r')
data = repr( file.read().decode('utf-8') )
get_records = re.compile(r"""openInfoWindowHtml\(.*?\\ticon:
myIcon\\n""").findall
get_titles = re.compile(r"""
On Tue, Feb 2, 2010 at 4:16 AM, Norman Khine wrote:
> here are the changes:
>
> import re
> file=open('producers_google_map_code.txt', 'r')
> data = repr( file.read().decode('utf-8') )
Why do you use repr() here?
> get_record = re.compile(r"""openInfoWindowHtml\(.*?\\ticon: myIcon\\n""")
> get
Norman Khine wrote:
thanks denis,
On Tue, Feb 2, 2010 at 9:30 AM, spir wrote:
On Mon, 1 Feb 2010 16:30:02 +0100
Norman Khine wrote:
On Mon, Feb 1, 2010 at 1:19 PM, Kent Johnson wrote:
On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine wrote:
thanks, what about the whi
Norman Khine, 02.02.2010 10:16:
> get_record = re.compile(r"""openInfoWindowHtml\(.*?\\ticon: myIcon\\n""")
> get_title = re.compile(r"""(.*)<\/strong>""")
> get_url = re.compile(r"""a href=\"\/(.*)\">En savoir plus""")
> get_latlng = re.compile(r"""GLatLng\((\-?\d+\.\d*)\,\\n\s*(\-?\d+\.\d*)\)""")
thanks denis,
On Tue, Feb 2, 2010 at 9:30 AM, spir wrote:
> On Mon, 1 Feb 2010 16:30:02 +0100
> Norman Khine wrote:
>
>> On Mon, Feb 1, 2010 at 1:19 PM, Kent Johnson wrote:
>> > On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine wrote:
>> >
>> >> thanks, what about the whitespace problem?
>> >
>> >
On Mon, 1 Feb 2010 16:30:02 +0100
Norman Khine wrote:
> On Mon, Feb 1, 2010 at 1:19 PM, Kent Johnson wrote:
> > On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine wrote:
> >
> >> thanks, what about the whitespace problem?
> >
> > \s* will match any amount of whitespace includin newlines.
>
> thank y
On Mon, Feb 1, 2010 at 1:19 PM, Kent Johnson wrote:
> On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine wrote:
>
>> thanks, what about the whitespace problem?
>
> \s* will match any amount of whitespace includin newlines.
thank you, this worked well.
here is the code:
###
import re
file=open('produ
On Mon, Feb 1, 2010 at 6:29 AM, Norman Khine wrote:
> thanks, what about the whitespace problem?
\s* will match any amount of whitespace includin newlines.
Kent
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
htt
On Mon, Feb 1, 2010 at 10:57 AM, spir wrote:
> On Mon, 1 Feb 2010 00:43:59 +0100
> Norman Khine wrote:
>
>> but this does not take into account of data which has negative values
>
> just add \-? in front of \d+
thanks, what about the whitespace problem?
>
> Denis
> _
On Mon, 1 Feb 2010 00:43:59 +0100
Norman Khine wrote:
> but this does not take into account of data which has negative values
just add \-? in front of \d+
Denis
la vita e estrany
http://spir.wikidot.com/
___
Tutor ma
Hello,
I am still unable to get this to work correctly!
In [1]: file=open('producers_google_map_code.txt', 'r')
In [2]: data = repr( file.read().decode('utf-8') )
In [3]: from BeautifulSoup import BeautifulStoneSoup
In [4]: soup = BeautifulStoneSoup(data)
In [6]: soup
http://paste.lisp.org/d
Hi
On Fri, Jan 22, 2010 at 7:44 PM, spir wrote:
> On Fri, 22 Jan 2010 14:11:42 +0100
> Norman Khine wrote:
>
>> but my problem comes when i try to list the GLatLng:
>>
>> GLatLng(9.696333, 122.985992);
>>
>> >>> StartingWithGLatLng = soup.findAll(re.compile('GLatLng'))
>> >>> StartingWithGLatLng
Hello,
I have the following http://paste.lisp.org/display/93732 txt file.
>From this I would like to extract
...
'ACP' +
'En savoir plus'
);
...
map.addOverlay(marqueur[1]);var latlng = new GLatLng(9.696333,
> > Hi Denis,
> >
> > Thanks for your input. So i decided i should use a pyparser and try it
> (im a
> > relative python noob though!)
>
Hi Everyone!
I have made some progress, although i believe it mainly due to luck and not
a lot of understanding (vague understanding maybe).
Hopefully this can
[Hope you don't mind I copy to the list. Not only it can help others, but
pyparsing users read tutor, including Paul MacGuire (author).]
Le Thu, 11 Jun 2009 11:53:31 +0200,
Stefan Lesicnik s'exprima ainsi:
[...]
I cannot really answer precisely for haven't used pyparsing for a while (*).
So,
On Wed, Jun 10, 2009 at 12:44 PM, Stefan Lesicnik wrote:
> Hi Guys,
>
> I have the following text
>
> [08 Jun 2009] DSA-1813-1 evolution-data-server - several vulnerabilities
> {CVE-2009-0547 CVE-2009-0582 CVE-2009-0587}
> [etch] - evolution-data-server 1.6.3-5etch2
> [lenny
Hi Guys,
I have the following text
[08 Jun 2009] DSA-1813-1 evolution-data-server - several vulnerabilities
{CVE-2009-0547 CVE-2009-0582 CVE-2009-0587}
[etch] - evolution-data-server 1.6.3-5etch2
[lenny] - evolution-data-server 2.22.3-1.1+lenny1
[04 Jun 2009] DSA-1812-1 ap
36 matches
Mail list logo