Re: Python parser problem

2012-12-13 Thread Chris Angelico
On Fri, Dec 14, 2012 at 6:30 PM, Paul Rudin wrote: > Chris Angelico writes: > >> On Fri, Dec 14, 2012 at 6:12 AM, RCU wrote: >>> Dave, >>> Thanks for the reply. >>> The script was originally edited on Windows with proper \r\n endings, >> >> It's worth noting that many Windows-based edi

Re: Python parser problem

2012-12-13 Thread Paul Rudin
Chris Angelico writes: > On Fri, Dec 14, 2012 at 6:12 AM, RCU wrote: >> Dave, >> Thanks for the reply. >> The script was originally edited on Windows with proper \r\n endings, > > It's worth noting that many Windows-based editors and interpreters are > quite happy with \n line endings.

Re: Python parser problem

2012-12-13 Thread Chris Angelico
On Fri, Dec 14, 2012 at 6:12 AM, RCU wrote: > Dave, > Thanks for the reply. > The script was originally edited on Windows with proper \r\n endings, It's worth noting that many Windows-based editors and interpreters are quite happy with \n line endings. You may be able to save yourself s

Re: Python parser problem

2012-12-13 Thread RCU
Dave, Thanks for the reply. The script was originally edited on Windows with proper \r\n endings, but the PythonTidy script somehow does the doubling (I guess it assumes UNIX format only), i.e., \r\r\n . So indeed, that's kind of messy (and the Python Lang Reference specifies clearly

Re: Python parser problem

2012-12-12 Thread Terry Reedy
On 12/12/2012 2:10 PM, RCU wrote: I would like to report a parser bug manifesting on Python 2.5, 2.7 (but not on 2.2) and 3.3. You are not the first to erroneously attribute a problem to Python itself. But seriously, the interpreter itself is so thoroughly tested on a daily basis that yo

Re: Python parser problem

2012-12-12 Thread Jerry Hill
On Wed, Dec 12, 2012 at 2:10 PM, RCU wrote: > With this occasion I would like to ask also what are the limits of the > Python 2.x and 3.x parser. Where can I find what are the limits on the > size/lines of the parsed script? The Python Language Reference is probably what you're looking for: h

Re: Python parser problem

2012-12-12 Thread Dave Angel
On 12/12/2012 02:10 PM, RCU wrote: > Hello. > I would like to report a parser bug manifesting on Python 2.5, 2.7 > (but not on 2.2) and 3.3. > Please see the attached script. > Basically this bug appeared after applying PythonTidy on a valid > script. > > More exactly, when runnin

Python parser problem

2012-12-12 Thread RCU
Hello. I would like to report a parser bug manifesting on Python 2.5, 2.7 (but not on 2.2) and 3.3. Please see the attached script. Basically this bug appeared after applying PythonTidy on a valid script. More exactly, when running: python -c "import iCam_GIT5_5"

Re: python-parser running Beautiful Soup only spits out one line of 10. What i have gotten wrong here?

2010-12-25 Thread John Nagle
Your program is doing what you asked it to do. It finds the first table with class 'bp_ergebnis_tab_info'. Then it ignores that results. Then it finds the first "td" item in the document, and prints the contents of that. Then it exits. What did you want it to do? Try this. It prints o

python-parser running Beautiful Soup only spits out one line of 10. What i have gotten wrong here?

2010-12-25 Thread Martin Kaspar
Hello dear Community,. I am trying to get a scraper up and running: And keep running into problems. when I try what you have i have learnedd so far I only get: Schuldaten Here is the code that I used: import urllib2 from BeautifulSoup import BeautifulSoup page = urllib2.urlopen("http://www.sch

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-12 Thread Stef Mientki
I've no opinion. >> I'm just struggling with BeautifulSoup myself, finding it one of the >> toughest libs I've seen ;-) > > Really? While I'm by no means an expert, I find it very easy to work with. > It's very well > structured IMHO. I think the cause lies in the documentation. The PySide docume

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Alexander Kapps
On 11.12.2010 22:38, Stef Mientki wrote: On 11-12-2010 17:24, Martin Kaspar wrote: Hello commnity i am new to Python and to Beatiful Soup also! It is told to be a great tool to parse and extract content. So here i am...: I want to take the content of a-tag of a table in a html document. For ex

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Peter Pearson
On Sat, 11 Dec 2010 22:38:43 +0100, Stef Mientki wrote: [snip] > So the simplest solution I came up with: > > Text = """ > > > > This is a sample text > > > > This is the second sample text > > >

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Stef Mientki
On 11-12-2010 17:24, Martin Kaspar wrote: > Hello commnity > > i am new to Python and to Beatiful Soup also! > It is told to be a great tool to parse and extract content. So here i > am...: > > I want to take the content of a -tag of a table in a html > document. For example, i have this table > >

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Nitin Pawar
try using lxml ... its very useful On Sat, Dec 11, 2010 at 11:24 AM, Martin Kaspar wrote: > Hello commnity > > i am new to Python and to Beatiful Soup also! > It is told to be a great tool to parse and extract content. So here i > am...: > > I want to take the content of a -tag of a table in a h

python-parser running Beautiful Soup needs to be reviewed

2010-12-11 Thread Martin Kaspar
Hello commnity i am new to Python and to Beatiful Soup also! It is told to be a great tool to parse and extract content. So here i am...: I want to take the content of a -tag of a table in a html document. For example, i have this table This is a sample te

Re: python parser overridden by pymol

2009-11-12 Thread Dave Angel
Robert Kern wrote: Jeremiah H. Savage wrote: To use pymol and numpy together, I now do the following: To ~/.bashrc add: PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol export PYMOL_PATH Then I can do the following in python: import numpy numpy.save('123',numpy.arra

Re: python parser overridden by pymol

2009-11-12 Thread Robert Kern
Jeremiah H. Savage wrote: To use pymol and numpy together, I now do the following: To ~/.bashrc add: PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol export PYMOL_PATH Then I can do the following in python: import numpy numpy.save('123',numpy.array([1,2,3])) numpy.

Re: python parser overridden by pymol

2009-11-12 Thread Jeremiah H. Savage
On Wed, Nov 11, 2009 at 7:48 PM, Dave Angel wrote: > > > Jeremiah wrote: >> >> Hello, >> >> I'm fairly new to python (version 2.5.4), and am writing a program >> which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from >> debian. >> >> It appears that when I add pymol to $PYTHONPATH, t

Re: python parser overridden by pymol

2009-11-11 Thread Dave Angel
Jeremiah wrote: Hello, I'm fairly new to python (version 2.5.4), and am writing a program which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. It appears that when I add pymol to $PYTHONPATH, that parser.expr() is no longer available, and so I am unable to use numpy.lo

Re: python parser overridden by pymol

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 17:41:07 -0800, Jeremiah wrote: > Hello, > > I'm fairly new to python (version 2.5.4), and am writing a program which > uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. > > It appears that when I add pymol to $PYTHONPATH, that parser.expr() is > no longe

Re: python parser overridden by pymol

2009-11-11 Thread Robert Kern
Jeremiah wrote: However, a problem arises once $PYTHONPATH includes the pymol directory. To use the pymol api, I add the following to ~/.bashrc: PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol export PYMOL_PATH PYTHONPATH=$PYMOL_PATH export PYTHONPATH Don't change your PYTHONPATH li

python parser overridden by pymol

2009-11-11 Thread Jeremiah
Hello, I'm fairly new to python (version 2.5.4), and am writing a program which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. It appears that when I add pymol to $PYTHONPATH, that parser.expr() is no longer available, and so I am unable to use numpy.load(). I have looked

Re: Python parser

2009-03-04 Thread Alan G Isaac
Gabriel Genellina wrote: Do you mean the simpleparser project in Sourceforge? http://simpleparse.sourceforge.net/ I thought this to be one of the most famous and useful Python parsers, because of its combination of simplicity and speed. Anyway, it is *very* good, and not having a version for

Re: Python parser

2009-03-04 Thread andrew cooke
Kay Schluehr wrote: > You'll most likely need a GLR parser. i'm not sure why you think this. as far as i can tell, the OP needs a parser that is suitable for whatever grammar they find (and the grammar will probably be written for a particular parser, which may not be GLR). however, if you are s

Re: Python parser

2009-03-03 Thread Kay Schluehr
On 2 Mrz., 23:14, Clarendon wrote: > Thank you, Lie and Andrew for your help. > > I have studied NLTK quite closely but its parsers seem to be only for > demo. It has a very limited grammar set, and even a parser that is > supposed to be "large" does not have enough grammar to cover common > words

Re: Python parser

2009-03-03 Thread Gabriel Genellina
En Tue, 03 Mar 2009 22:39:19 -0200, Alan G Isaac escribió: This reminds me: the SimpleParse developers ran into some troubles porting to Python 2.6. It would be great if someone could give them a hand. Do you mean the simpleparser project in Sourceforge? Latest alpha released in 2003? Or

Re: Python parser

2009-03-03 Thread Alan G Isaac
This reminds me: the SimpleParse developers ran into some troubles porting to Python 2.6. It would be great if someone could give them a hand. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Python parser

2009-03-02 Thread andrew cooke
Clarendon wrote: [...] > I need to parse a large amount of texts collected from the web (around > a couple hundred sentences at a time) very quickly, so I need a parser > with a broad scope of grammar, enough to cover all these texts. This > is what I mean by 'random'. so the most important things

Re: Python parser

2009-03-02 Thread Robert Kern
On 2009-03-02 16:14, Clarendon wrote: Thank you, Lie and Andrew for your help. I have studied NLTK quite closely but its parsers seem to be only for demo. It has a very limited grammar set, and even a parser that is supposed to be "large" does not have enough grammar to cover common words like "

Re: Python parser

2009-03-02 Thread Clarendon
Thank you, Lie and Andrew for your help. I have studied NLTK quite closely but its parsers seem to be only for demo. It has a very limited grammar set, and even a parser that is supposed to be "large" does not have enough grammar to cover common words like "I". I need to parse a large amount of t

Re: Python parser

2009-03-02 Thread andrew cooke
if this is for natural language texts you may want to look at http://www.nltk.org/ andrew Clarendon wrote: > Can somebody recommend a good parser that can be used in Python > programs? I need a parser with large grammar that can cover a large > amount of random texts. > > Thank you very much. >

Re: Python parser

2009-03-02 Thread Lie Ryan
Clarendon wrote: > Can somebody recommend a good parser that can be used in Python > programs? Do you want parser that can parse python source code or parser that works in python? If the latter, pyparsing is a popular choice. Ply is another. There are many choice: http://nedbatchelder.com/text/pyt

Python parser

2009-03-02 Thread Clarendon
Can somebody recommend a good parser that can be used in Python programs? I need a parser with large grammar that can cover a large amount of random texts. Thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed with controlling the python parser

2006-01-10 Thread André
quot;] .for word in bad_keywords: .if word in contents: .mesg = "Keyword or function not allowed:" + str(word) .return False, mesg .return True, '' I would augment it with a regular expression to catch "__*". [This is left as an exe

Help needed with controlling the python parser

2006-01-10 Thread vinjvinj
l the python parser to do this? Thanks, VJ -- http://mail.python.org/mailman/listinfo/python-list

Re: seek python parser

2005-08-07 Thread Paul Boddie
I tend to use the compiler module: http://docs.python.org/lib/compiler.html With the output of the parsing functions I selectively inspect the AST nodes using the named attributes listed in the documentation: http://docs.python.org/lib/module-compiler.ast.html For cases where one just needs to

seek python parser

2005-08-06 Thread Evil Bastard
Hi, Does anyone know of a python source parser program which can return the parsed source file as a coherent dom-like data structure? I'm playing around with ast, and the output of ast.tolist(), but it's got a lot of chaff, and would need a lot of hacking to break it down to simple data structure

Re: python parser

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 13:30:14 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >tuxlover wrote: >> Hello everyone >> >> I have to write a verilog parser in python for a class project. I was >> wondering if all you folks could advise me on choosing the right

Re: python parser

2005-07-12 Thread Robert Kern
tuxlover wrote: > Hello everyone > > I have to write a verilog parser in python for a class project. I was > wondering if all you folks could advise me on choosing the right python > parser module. I am not comfortable with lex/yacc and as a result find > myself strugging wit

Re: python parser

2005-07-12 Thread matt
I recently was successful using pyparsing after messing around with ply for a few hours. See my blog for more details ( http://panela.blog-city.com/icfp_contest_implementation_in_python_notes.htm ). I personally corresponded with the author and he was very helpful as well, giving my useful critiq

Re: python parser

2005-07-12 Thread Christopher Subich
tuxlover wrote: > I have to write a verilog parser in python for a class project. I was > wondering if all you folks could advise me on choosing the right python > parser module. I am not comfortable with lex/yacc and as a result find > myself strugging with any module which use lex

python parser

2005-07-12 Thread tuxlover
Hello everyone I have to write a verilog parser in python for a class project. I was wondering if all you folks could advise me on choosing the right python parser module. I am not comfortable with lex/yacc and as a result find myself strugging with any module which use lex/yacc syntax/philosophy