473,324 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Automated Perl to Python translation?

I need to translate some Perl scripts into Python.

When I went looking for a tool that would help automate the
translation, I was rather surprised that I couldn't find anything.
BridgeKeeper, the only real candidate that I could find, is no longer
available. There are of course general-purpose parsing packages, but
I'm looking for something target specifically to Perl-to-Python
translation.

Since I couldn't find anything, I've started to write my own.
Preliminary results are good, but before I spend any more time on it I
want to be really sure that I'm not re-inventing the wheel.

Does anybody know of any tools to automate (or assist) Perl to Python
translation?
Jul 18 '05 #1
6 3746
st***@ferg.org (Stephen Ferg) wrote in message news:<b1**************************@posting.google. com>...
I need to translate some Perl scripts into Python.

When I went looking for a tool that would help automate the
translation, I was rather surprised that I couldn't find anything.
BridgeKeeper, the only real candidate that I could find, is no longer
available. There are of course general-purpose parsing packages, but
I'm looking for something target specifically to Perl-to-Python
translation.

Since I couldn't find anything, I've started to write my own.
Preliminary results are good, but before I spend any more time on it I
want to be really sure that I'm not re-inventing the wheel.

Does anybody know of any tools to automate (or assist) Perl to Python
translation?


don't know but there is a book out.
Perl to Python Migration
by Martin C. Brown

Cheers.
Jul 18 '05 #2
st***@ferg.org (Stephen Ferg) wrote in message news:<b1**************************@posting.google. com>...
I need to translate some Perl scripts into Python.

When I went looking for a tool that would help automate the
translation, I was rather surprised that I couldn't find anything.
BridgeKeeper, the only real candidate that I could find, is no longer
available. There are of course general-purpose parsing packages, but
I'm looking for something target specifically to Perl-to-Python
translation.

Since I couldn't find anything, I've started to write my own.
Preliminary results are good, but before I spend any more time on it I
want to be really sure that I'm not re-inventing the wheel.

Does anybody know of any tools to automate (or assist) Perl to Python
translation?


My goodness - sounds like quite a project. Now if you could make it
two way that would be really interesting...

Cool.

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Jul 18 '05 #3
Stephen Ferg wrote:
I need to translate some Perl scripts into Python.

When I went looking for a tool that would help automate the
translation, I was rather surprised that I couldn't find anything.
BridgeKeeper, the only real candidate that I could find, is no longer
available. There are of course general-purpose parsing packages, but
I'm looking for something target specifically to Perl-to-Python
translation.

Since I couldn't find anything, I've started to write my own.
Preliminary results are good, but before I spend any more time on it I
want to be really sure that I'm not re-inventing the wheel.

Does anybody know of any tools to automate (or assist) Perl to Python
translation?


This is a great feat of worth I'll say. I remembered reading somewhere
that Jython uses JavaCC, so perhaps looking in that direction can be of
some help.

PLY is one of the pure python lex/yacc system I can find. There is also
SPARK, but John Aycock had left the university. PLY is partially based
on SPARK.

If this can be worked out, Perl/Python/Java combination is too powerful
to imagine......

Maurice
Jul 18 '05 #4
In article <6e**************************@posting.google.com >,
yaipa h. <ya***@yahoo.com> wrote:

don't know but there is a book out.
Perl to Python Migration
by Martin C. Brown


Not particularly useful.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"A foolish consistency is the hobgoblin of little minds, adored by little
statesmen and philosophers and divines." --Ralph Waldo Emerson
Jul 18 '05 #5
Maurice LING ha scritto:

If this can be worked out, Perl/Python/Java combination is too powerful
to imagine......


I think you'd be happy with parrot or .net ;)
Jul 18 '05 #6
> Stephen Ferg wrote:
[...]
Does anybody know of any tools to automate (or assist) Perl to Python
translation?
Perl has a notoriously hairy lexical structure. Maybe the parsing
isn't much fun either. The "only perl can parse Perl" quote (Larry
Wall?) springs to mind. Given that, and working on the assumption
you're sufficiently insane to go through with this project <wink>, I
guess you'd definitely want to do precisely that: use perl to parse
the Perl code.

Bon chance.

[...]
Maurice LING <ma*********@acm.org> writes: If this can be worked out, Perl/Python/Java combination is too
powerful to imagine......


:-( I don't think that's a reason for wanting a translator. If you
just want to call Python from Perl, or call Perl from Python, I guess
you'd use pyperl (though I don't know if it's actively maintained).
John
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Fred Ma | last post by:
Hello, This is not a troll posting, and I've refrained from asking because I've seen similar threads get all nitter-nattery. But I really want to make a decision on how best to invest my time....
4
by: Xah Lee | last post by:
while programing in Python, one can lookup syntax or info for keywords or modules within Python. In the command line, type python to get into the python interactive program. then type...
5
by: Xah Lee | last post by:
© # this is an example of for statement © # the % symbol calculates the remainder © # of division. © # the range(m,n) function © # gives a list from m to n-1. © © a = range(1,51) © for x in a:...
4
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # to open a file and write to file # do f=open('xfile.txt','w') # this creates a file "object" and name it f. # the second argument of open can be
2
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © # in Python, one can define a boxed set © # of data and functions, which are © # traditionally known as "class". © © # in the following, we define a...
2
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # suppose you want to fetch a webpage. from urllib import urlopen print urlopen('http://xahlee.org/Periodic_dosage_dir/_p2/russell-lecture.html').read() #...
41
by: Xah Lee | last post by:
here's another interesting algorithmic exercise, again from part of a larger program in the previous series. Here's the original Perl documentation: =pod merge($pairings) takes a list of...
20
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the β€œsort” method. For example: ...
3
by: Xah Lee | last post by:
Split File Fullpath Into Parts Xah Lee, 20051016 Often, we are given a file fullpath and we need to split it into the directory name and file name. The file name is often split into a core...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.