Miscellaneous tutorials
|
|---|
Many parsing tools have been written for Python. This column discusses a high-level parsing language built on top of Python. SimpleParse provides an EBNF-style syntax on top of mxTextTools that can greatly clarify the expression of grammars.
Like most programmers, I have frequently needed to identify parts and structures that exist inside textual documents: log files, configuration files, delimited data, and more free-form (but still semi-structured) report formats. All of these documents have their own "little languages" for what can occur within them.
The way I have programmed these informal parsing tasks has always been somewhat of a hodgepodge of custom state-machines, regular expressions, and context-driven string tests. The pattern in these programs was always, roughly, "read a bit of text, figure out if we can make something of it, maybe read a bit more text afterwards, keep trying."
Parsers of the formal variety distill descriptions of the parts and structures in documents into concise, clear, and declarative rules for how to identify what makes up a document. The declarative aspect is particularly interesting here. All my old ad hoc parsers were imperative in flavor: read some characters, make some decisions, accumulate some variables, rinse, repeat. As this column's installments on functional programming have observed, the recipe style of program flow is comparatively error-prone and difficult to maintain.
| | Hits:432 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
| | | |
|---|
Python for the PalmOS
Pippy is a port of (a subset of) Python to the PalmOS. With Pippy, Python programmers can create custom applications to run on Palm devices, as well as use Pippy as an interactive environment directly on the Palm. This article evaluates the strengths and limitations of Pippy as a means of implementing Palm applications.
| | Hits:206 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
| | | |
|---|
Extending Python and Zope in C
Extending Python in C is easy once you see how it all works, and an extension of Python is equally easy to package up for Zope. The hard part is wading through the different documentation sets in search of the nuggets of information you need, and this article has collected them for you. Article includes code snipets.
| | Hits:180 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
| | | |
|---|
Python with ASP
A little demo on how to embed Python into HTML.
| | Hits:149 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
| | | |
|---|
A quick look at Python modules
This article introduces the idea of importing Python modules that manage many common and/or special tasks that you would otherwise have to write programming code for. IDLE is featured in this article because of some of its handy features, but you can follow the examples in other ways as well.
| | Hits:125 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
| | | |
|
|---|
A quick look at Python modules
This article introduces the idea of importing Python modules that manage many common and/or special tasks that you would otherwise have to write programming code for. IDLE is featured in this article because of some of its handy features, but you can follow the examples in other ways as well.
| | Hits:125 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
|
|---|
Python with ASP
A little demo on how to embed Python into HTML.
| | Hits:149 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
|
|---|
Many parsing tools have been written for Python. This column discusses a high-level parsing language built on top of Python. SimpleParse provides an EBNF-style syntax on top of mxTextTools that can greatly clarify the expression of grammars.
Like most programmers, I have frequently needed to identify parts and structures that exist inside textual documents: log files, configuration files, delimited data, and more free-form (but still semi-structured) report formats. All of these documents have their own "little languages" for what can occur within them.
The way I have programmed these informal parsing tasks has always been somewhat of a hodgepodge of custom state-machines, regular expressions, and context-driven string tests. The pattern in these programs was always, roughly, "read a bit of text, figure out if we can make something of it, maybe read a bit more text afterwards, keep trying."
Parsers of the formal variety distill descriptions of the parts and structures in documents into concise, clear, and declarative rules for how to identify what makes up a document. The declarative aspect is particularly interesting here. All my old ad hoc parsers were imperative in flavor: read some characters, make some decisions, accumulate some variables, rinse, repeat. As this column's installments on functional programming have observed, the recipe style of program flow is comparatively error-prone and difficult to maintain.
| | Hits:432 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
|
|---|
Extending Python and Zope in C
Extending Python in C is easy once you see how it all works, and an extension of Python is equally easy to package up for Zope. The hard part is wading through the different documentation sets in search of the nuggets of information you need, and this article has collected them for you. Article includes code snipets.
| | Hits:180 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
|
|---|
Python for the PalmOS
Pippy is a port of (a subset of) Python to the PalmOS. With Pippy, Python programmers can create custom applications to run on Palm devices, as well as use Pippy as an interactive environment directly on the Palm. This article evaluates the strengths and limitations of Pippy as a means of implementing Palm applications.
| | Hits:206 Rate: 0.0(out of 5) Vote:0 Submit Date :2006-03-29 Rate It | Error | Review |
|
|
WebmastersHome.com Discussion about programming, SEO, WebHosting and more! |
|