0
votes

I currently have a quite big program written in FoxPro (prg file). Now FoxPro is actually really getting outdated, so what I want to ask is the following:

Is it possible to convert all the FoxPro code (.prg file) to Python? Is there a simple trick/code for this? Python has to become my main coding platform, so I don't need to use FoxPro anymore for when I want to adjust some code or something else. Does someone have experience with this?

I hope to hear from you, appreciate your help.

PS: Please note that I am quite new to Python.

2
Does your program need a database? Is your application single- or multi-user? If it's a single-user application without database, it should be fairly easy to convert your code manually. If you got the basics in Python, you need to find some GUI-Framework to settle on with. Converting your Foxpro-Forms to Python is probably going to be the most advanced thing. Edit: As others have mentioned, it defintely will be more time consuming to fix the errors generated by a converter-tool, than re-writing the code.DerHamm
Many years ago, a veteran VFP developer named Ed Leafe created a Python framework name Dabo, which was, I believe, meant to be an easy transition for VFP developers. I don't know it's current status, but that would be a place to start.Tamar E. Granor
@TamarE.Granor It seems Dabo is currently in maintenance mode. It was written for Python 2 and porting to Python 3 is not complete. The github repo isn't very active.Roland Smith
@DerHamm, Yes my program needs a database and as far as I know, its a multi-user because we use it within our organization. I'm aware of the fact that rewriting is maybe the best option.ManCity10

2 Answers

1
votes

There are plenty of people from the FoxPro community who migrated into the Python world certainly, but there are no tools that I know of for converting source code. As with most of these 'can I convert from language x to language y' questions, you would spend more time getting the result into shape than you would just documenting and rewriting.

There are some Python scripts that implement common Visual FoxPro functions in the download section on Leafe.com which might help.

0
votes

You might want to check out this question.

There is also vfp2py.

Python comes with support for excellent SQLite database built-in with the sqlite3 module. (You are probably aready using sqlite, but you might not even know it.) Storing the data in an sqlite database means you will not have to worry about not being able to access it for the rest of your life.