Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rexx parse ->phyton ?

132 views
Skip to first unread message

Mario Sacco

unread,
Nov 14, 2013, 11:00:14 AM11/14/13
to
Also if could appear OT ... I'm sure this is the right place to ask!
This because only who knows well REXX can answer to my question.

I'm looking for some like REXX PARSE to manage strings in Phyton. I
searched the web without interesting results.

Could anyone tell me if there is an extension of Phyton to manage the
string parsing at least similar to REXX PARSE?

Thanks

pg

unread,
Nov 16, 2013, 4:35:27 AM11/16/13
to
Ok, Ok, I understand, there is NOTHING like REXX PARSE in Phyton :-)

Swifty

unread,
Nov 17, 2013, 2:33:24 AM11/17/13
to
On 16/11/2013 09:35, pg wrote:
> I understand, there is NOTHING like REXX PARSE in Phyton

In your situation I'd try one of these approaches:

1. Write my own PARSE() function in Python (I have no idea if Python
supports user written functions)
- I'm assuming that you meant pytHon.

2. If this is too hard/too much effort then perhaps you could write a
parse.rex program which you can call/execute from python?
I did the opposite, wrote a popup() function in REXX which calls a
small .vsb program that I wrote. I wanted a popup window with a
timeout facility.

--
Steve Swift
http://www.swiftys.org.uk/

Mario Sacco

unread,
Nov 17, 2013, 4:15:51 AM11/17/13
to
Hello Steve,
thanks for your post.
I look a long on Phytos site about packages, but there is nothing so
powerful like REXX PARSE.
Yes, you are right, it's possible to write my own parsing functions.

Thanks,
Mario

Jeremy Nicoll - news posts

unread,
Nov 17, 2013, 7:13:27 AM11/17/13
to
Swifty <steve....@gmail.com> wrote:

>On 16/11/2013 09:35, pg wrote:
>> I understand, there is NOTHING like REXX PARSE in Phyton
>
>In your situation I'd try one of these approaches:
>
>1. Write my own PARSE() function in Python (I have no idea if Python
> supports user written functions)

It does support user-written stuff, and it also already has numerous ways of
parsing things, including much more sophisticated support than REXX has, eg
building parse trees...

It probably doesn't have a single function that can be used in as many
different ways as our parse though; the programmer probably has to look for
the best tool for what they want to do.

The stackoverflow website/forum is a good place to find hints on programming
in many languages, so for example:

http://stackoverflow.com/questions/5749195/how-can-i-split-and-parse-a-string-in-python


For lots of links to info about building parsers in / via Python:

http://nedbatchelder.com/text/python-parsers.html

Most of that is too complex I think, but see the stuff mentioned at
"Standard Modules" ... and read the Python docs for those modules.


--
Jeremy C B Nicoll - my opinions are my own.

Email sent to my from-address will be deleted. Instead, please reply
to newsre...@wingsandbeaks.org.uk replacing "aaa" by "284".

Andreas Schnellbacher

unread,
Dec 6, 2013, 8:43:31 AM12/6/13
to
Mario Sacco wrote:

> I look a long on Phytos site about packages, but there is nothing so
> powerful like REXX PARSE.
>
> Yes, you are right, it's possible to write my own parsing functions.

I've just remembered that I'd downloaded an implementation of the REXX
parse statement for VB 6. This might a could point to start:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=53225&lngWId=1
http://www.planetsourcecode.com/Upload_PSC/ftp/PARSER1734604172004.zip

--
Andreas Schnellbacher

Mario Sacco

unread,
Dec 25, 2013, 7:03:14 PM12/25/13
to
Thanks Andreas! You gave me also the opportunity to discover and
interesting website.
0 new messages