> >> > Given
> >> >
> >> > data =
> >> > '{[][]}'
> >> >
> >> > How can I efficiently get dictionaries for each of the data blocks
> >> > framed by <> ?
> >> >
> >> > Thanks for any help
> >>
> >> The question here is: What _can't_ happen? For instance, what happens
> >> if Fred's name contains
On Wed, Feb 18, 2015 at 3:35 PM, wrote:
>> > Given
>> >
>> > data =
>> > '{[][]}'
>> >
>> > How can I efficiently get dictionaries for each of the data blocks framed
>> > by <> ?
>> >
>> > Thanks for any help
>>
>> The question here is: What _can't_ happen? For instance, what happens
>> if Fred
> > Given
> >
> > data =
> > '{[][]}'
> >
> > How can I efficiently get dictionaries for each of the data blocks framed
> > by <> ?
> >
> > Thanks for any help
>
> The question here is: What _can't_ happen? For instance, what happens
> if Fred's name contains a greater-than symbol, or a caret?
On Wed, Feb 18, 2015 at 3:07 PM, wrote:
> Given
>
> data = '{[][]}'
>
> How can I efficiently get dictionaries for each of the data blocks framed by
> <> ?
>
> Thanks for any help
The question here is: What _can't_ happen? For instance, what happens
if Fred's name contains a greater-than symbol
Given
data = '{[][]}'
How can I efficiently get dictionaries for each of the data blocks framed by <>
?
Thanks for any help
KP
--
https://mail.python.org/mailman/listinfo/python-list
On 6/14/2014 8:10 PM, Michael Torrie wrote:
On 06/13/2014 03:05 PM, Eric S. Johansson wrote:
I appreciate any insight before I go too far off track.
--- eric
Perhaps this is off-topic, and doesn't answer your question, but is
Parsley a natural language parsing tool? If not, and if it is natur
On 06/13/2014 03:05 PM, Eric S. Johansson wrote:
> I appreciate any insight before I go too far off track.
> --- eric
Perhaps this is off-topic, and doesn't answer your question, but is
Parsley a natural language parsing tool? If not, and if it is natural
language that you're trying to parse, may
In my quest for making speech friendly applications, I've developed a
very simple domain specific language/notation that works well. I'm using
parsley which is a great tool for writing parsers especially simple ones
like the one I need. However, I've come across a problem that I don't
know how
how do you parse multi line text with parsley? here is a work in
progress and I'm trying to figure out why I need to split the text and
process per line vrs all at one go.
thanks for any help.
--- eric
Here's the whole body of code ---
import parsley
#
# grammar to pa
"Eric S. Johansson" wrote in message
news:mailman.2752.1343700723.4697.python-l...@python.org...
On 7/30/2012 9:54 PM, Steven D'Aprano wrote:
It would please me greatly if you would be willing to try an experiment.
live my life for a while. Sit in a chair and tell somebody what to type
and w
On Tue, Jul 31, 2012 at 11:54 AM, Steven D'Aprano
wrote:
> Google Docs is, in my opinion, a nasty piece of rubbish
> that doesn't run on any of my browsers. As far as I'm concerned, I'd
> rather download a Word doc, because at least I can open that in
> OpenOffice or Abiword and read it. Something
On 7/30/2012 10:54 PM, Tim Chase wrote:
On 07/30/12 21:11, Eric S. Johansson wrote:
the ability for multiple people to work on the same document at
the same time is really important. Can't do that with Word or
Libre office. revision tracking in traditional word processors
are unpleasant to work
On Mon, Jul 30, 2012 at 8:54 PM, Tim Chase
wrote:
> I've tried a similar experiment and am curious on your input device.
> Eye-tracking/dwell-clicking? A sip/puff joystick? Of the various
> input methods I tried, I found that Dasher[1] was the most
> intuitive, had a fairly high input rate and
On 07/30/12 21:11, Eric S. Johansson wrote:
> the ability for multiple people to work on the same document at
> the same time is really important. Can't do that with Word or
> Libre office. revision tracking in traditional word processors
> are unpleasant to work with especially if your hands a
On 7/30/2012 9:54 PM, Steven D'Aprano wrote:
On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote:
If you have been reading the papers, you would understand what I'm
doing.
That is the second time, at least, that you have made a comment like that.
Actually, it's probably more like the
On Mon, 30 Jul 2012 11:40:50 -0400, Eric S. Johansson wrote:
> If you have been reading the papers, you would understand what I'm
> doing.
That is the second time, at least, that you have made a comment like that.
Understand that most people are not going to follow links to find out
whether or
al message-
From:Eric S. Johansson
Sent:Mon 30-07-2012 12:00
Subject:Re: simplified Python parsing question
To:python-list@python.org;
On 7/30/2012 5:25 AM, Laszlo Nagy wrote:
>
> Did you try to use pygments?
>
> http://pygments.org/docs/api/
>
thanks, I'll take a look.
>
On 7/30/2012 10:59 AM, Laszlo Nagy wrote:
yeah the problem is also little more complicated than simple parsing of
Python code. For example, one example (from the white paper)
*meat space blowback = Friends and family [well-meaning attempt]
*could that be parsed by the tools you mention?
yeah the problem is also little more complicated than simple parsing
of Python code. For example, one example (from the white paper)
*meat space blowback = Friends and family [well-meaning attempt]
*could that be parsed by the tools you mention?
It is not valid Python code. Pygments is ab
On 7/30/2012 5:25 AM, Laszlo Nagy wrote:
Did you try to use pygments?
http://pygments.org/docs/api/
thanks, I'll take a look.
I would first tokenize the code, then divide it by statement keywords.
Finally, you just need to find expression/assignment statements in the
remaining sections.
I appreciate the help because I believe that once this is working,
it'll make a significant difference in the ability for disabled
programmers to write code again as well as be able to integrate within
existing development team and their naming conventions.
Did you try to use pygments?
htt
"Eric S. Johansson" writes:
> When you are sitting on or in a name, you look to the left or look to
> the right what would you see that would tell you that you have gone
> past the end of that name. For example
>
> a = b + c
>
> if you are sitting on a, the boundaries are beginning of line and =,
On 7/29/2012 11:33 PM, Steven D'Aprano wrote:
On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote:
When you are sitting on or in a name, you look to the left or look to
the right what would you see that would tell you that you have gone past
the end of that name. For example
Have you r
On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote:
> When you are sitting on or in a name, you look to the left or look to
> the right what would you see that would tell you that you have gone past
> the end of that name. For example
Have you read the docs? It gives full details of the
as some folks may remember, I have been working on making Python and its tool
base more accessible to disabled programmers. I've finally come up with a really
simple technique which should solve 80% of the problem. What I need to figure
out is how to find a spot in the code where a symbol exists
Gavin writes:
> python-dateutil seems to work very well if everything is in English,
> however, it does not seem to work for other languages and the
> documentation does not seem to have any information about locale
> support.
Probably because I don't think there is much built in. You'll want t
Hi,
I'm using the python-dateutil package : http://labix.org/python-dateutil
to parse a set of randomly formatted strings into dates. Because the
formats are varied, I can't use time.strptime() because I don't know
what the format is upfront.
python-dateutil seems to work very well if everythin
On 05/31/2010 08:42 AM, Mag Gam wrote:
I have a file with bunch of nfsstat -c (on AIX) which has all the
hostnames, for example
...
Is there a an easy way to parse this file according to each host?
So,
r1svr.Connectionless.calls=6553
r1svr.Connectionless.badcalls=0
and so on...
I am current
I have a file with bunch of nfsstat -c (on AIX) which has all the
hostnames, for example
r1svr==
Client rpc:
Connection oriented
calls badcalls badxids timeouts newcreds badverfs timers
0 0 0 0 0 0 0
nomem cantconn i
Great. That worked for me. I had some of my routines implemented in
Perl earlier. Now that I started using Python I am trying to do all my
automation scripts with Python. Thanks a ton
Jee
On 9/13/07, Peter Otten <[EMAIL PROTECTED]> wrote:
> Dennis Lee Bieber wrote:
>
> > for line in inp:
> >
> >
Dennis Lee Bieber wrote:
> for line in inp:
>
> will read one line at a time (I'm fairly sure the iterator doesn't
> attempt to buffer multiple lines behind the scenes)
You are wrong:
>>> open("tmp.txt", "w").writelines("%s\n" % (9*c) for c in "ABCDE")
>>> instream = open("tmp.txt")
>>> for li
Am Wed, 12 Sep 2007 17:28:08 -0500 schrieb Shankarjee Krishnamoorthi:
> I would prefer to use something with seek.
Writing Perl in any language?
> I am not able to use seek()
> with "for line in inp". Use tell and seek does not seem to do anything
> with the code. When I try to do
>
> for line
> for line in inp.readlines():
If you are now using readlines() instead of readline(), then
a) it is only used once to read all data into a container
b) you can access each element/line by it's relative number
data=open(filename, "r").readlines()
for eachline in data : (not readlines())
so try
I would prefer to use something with seek. I am not able to use seek()
with "for line in inp". Use tell and seek does not seem to do anything
with the code. When I try to do
for line in inp.readlines():
# Top of Loop
if not condition in line:
do_something
else:
fo
I'm assuming you know that python has a file.seek(), but you have to
know the number of bytes you want to move from the beginning of the
file or from the current location. You could save the length of the
previous record, and use file seek to backup and then move forward,
but it is simpler to save
Save the previous line in a variable if you want the previous line
only.
for line in inp:
# Perform some operations with line
if condition something:
print prev_line
print line
break
# I need to go back one line and use that line value
--> prev_line = line
I
Hi,
I am new to Python. I am trying to do the following
inp = open(my_file,'r')
for line in inp:
# Perform some operations with line
if condition something:
# Start re reading for that position again
for line in inp:
if some other condition
"Kun" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i have a list of that is:
>
> [('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Friend
> <[EMAIL PROTECTED]>\r\n\r\n'), ')', ('462 (BODY[HEADER.FIELDS (FROM)] {37}',
> 'From: Kun <[EMAIL PROTECTED]>\r\n\r\n'), ')']
>
>
> how do i pa
"Kun" wrote:
> i tried to parse (below) with the regular expression: emails =
> re.findall('\S*\s([EMAIL PROTECTED])', senders)
>
> and got the following error:
>
> Traceback (most recent call last):
>File "/Life/School/Homework/Spring 2006/OPIM
> 399/Tutorial/IMAP/scannermailer.py", line 19,
[EMAIL PROTECTED] wrote:
> Use Regular expressions
> http://docs.python.org/lib/module-re.html
>
i tried to parse (below) with the regular expression: emails =
re.findall('\S*\s([EMAIL PROTECTED])', senders)
and got the following error:
Traceback (most recent call last):
File "/Life/School/H
Use Regular expressions
http://docs.python.org/lib/module-re.html
--
http://mail.python.org/mailman/listinfo/python-list
i have a list of that is:
[('460 (BODY[HEADER.FIELDS (FROM)] {46}', 'From: Friend
<[EMAIL PROTECTED]>\r\n\r\n'), ')', ('462 (BODY[HEADER.FIELDS (FROM)] {37}',
'From: Kun <[EMAIL PROTECTED]>\r\n\r\n'), ')']
how do i parse the email addresses out of it into another list or string?
--
http://mai
42 matches
Mail list logo