Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10203

Re: Refactor/Rewrite Perl code in Python

References <CAFFfdLJ_u0PC7YneQK9eYiEzuZNizRab4U=1HMVowB3esKP5pQ@mail.gmail.com>
Date 2011-07-24 19:45 +1000
Subject Re: Refactor/Rewrite Perl code in Python
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1419.1311500714.1164.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Jul 24, 2011 at 7:29 PM, Shashwat Anand
<anand.shashwat@gmail.com> wrote:
> How do I start ?
> The idea is to rewrite module by module.
> But how to make sure code doesn't break ?
> How can I import perl and python codes in each other ?

Can you separate the project into separate executables that call on
each other? You can pipe text from stdout of perl to stdin of python,
for instance. Otherwise, it's not going to be easy. But if you're
going to change the underlying database AND the code at the same time,
it may be best to simply set aside the old code completely and code a
brand new system in Python, capitalizing on the Second Mouse Effect
(the early bird gets the worm, but the second mouse gets the cheese).
You can learn from all the mistakes made in the first version,
allowing you to make an entirely new set of mistakes. :)

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Refactor/Rewrite Perl code in Python Chris Angelico <rosuav@gmail.com> - 2011-07-24 19:45 +1000
  Re: Refactor/Rewrite Perl code in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-24 21:39 +1000
    Re: Refactor/Rewrite Perl code in Python J Kenneth King <james@agentultra.com> - 2011-07-25 11:00 -0400
      RE: Refactor/Rewrite Perl code in Python "Sells, Fred" <fred.sells@adventistcare.org> - 2011-07-25 17:10 -0400

csiph-web