# Convert python script in ruby

**URL:** <https://rubytalk.org/t/convert-python-script-in-ruby/4981>\
**Category:** ruby-talk\
**Created:** [2 March 2003 21:17 UTC](https://rubytalk.org/t/convert-python-script-in-ruby/4981 "2003-03-02T21:17:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Chou](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@Albert\_Chou](https://rubytalk.org/u/Albert_Chou)\
**Post date:** [2 March 2003 21:17 UTC](https://rubytalk.org/t/convert-python-script-in-ruby/4981/1 "2003-03-02T21:17:10Z")

</div>

No, mine is a purely syntactic translator based on regular expressions,  
with some domain-specific ones that know how to convert from particular  
Python package usages (including translating “import” to “require”  
statements). Nothing as interesting as yours, but it does the tedious  
majority of the translation I needed for seeing if I could port FIT from  
Python to Ruby (easier than Java to Ruby, I felt).

I would be happy to share my script, though it’s not on the machine I’m  
emailing from this moment, so please remind me to send it.

Al

> **···**
>
> -----Original Message-----  
> From: Robert Feldt  
> Sent: Fri 2/28/2003 11:00 PM  
> To: ruby-talk ML  
> Subject: Re: Convert python script in ruby
> 
> On Sat, 1 Mar 2003, Albert Chou wrote:
> 
> > I’ve been working on a Ruby script that does a great deal of the  
> > translation from Python to Ruby, but it’s by no means a complete  
> > solution, and I don’t know whether it ever will be.
> 
> Interesting, do you have a Python parser in there?
> 
> I have the starts of a python-to-ruby translator in Python (don’t throw  
> rotten tomatoes please, I wanted to check it out). Its very simple to do  
> that in Python since they export an API to the internal parser so you  
> get  
> a full Python parser with AST representation “for free” (hint, hint matz  
> and I know you have it in the TODO).
> 
> I think our community would really benefit from such a tool; when we  
> find  
> some extension they have that we want the tool would give a head start  
> in  
> translating.
> 
> If your tool is close to complete I don’t want to put more effort into  
> mine. It was really just a hack I did when checking out Python. Is there  
> a  
> way we can join forces and get something more complete faster?
> 
> Regards,
> 
> Robert Feldt
