pythonwxpythonwxformbuilder

WxFormBuilder has no Python option


How can I generate python code? I know I need to change code_generation property from C++ to Python, but there is no Python option... How can i fix this? I have already tried looking for this problem on the internet, but I couldn't find anything.


Solution

  • Since you didn't specify your OS, I will just review tips for the 3 major ones.

    For Windows, the beta release from wxFormBuilder's SourceForge page, version 3.4.x, is able to generate Python code so perhaps try installing that version. I installed this on my Windows box earlier this year and Python was definitely one of the options.

    For Linux, it looks like if you installed wxFormBuilder from your distro's software center or manager, you get an older version of the FB, most likely 3.1.xx, which doesn't generate Python code.

    In order to obtain the latest (beta) version which does generate Python code, just add the wxFormBuilder PPA.

    First, install wxWidgets 3.0 to obtain the prerequisites for wxFormBuilder:

    sudo add-apt-repository -y ppa:wxformbuilder/wxwidgets
    sudo apt-get update
    sudo apt-get install libwxgtk3.0-0 libwxgtk-media3.0-0
    

    Now, install the latest wxFormBuilder release:

    sudo add-apt-repository -y ppa:wxformbuilder/release
    sudo apt-get update
    sudo apt-get install wxformbuilder
    

    After this, you should have wxFormBuilder 3.4.x and should see options for generating code in Python, Lua, PHP in addition to C++/XRC.

    This worked for me, but if it doesn't for you, you can try installing from source. Just take a look at the instructions from the SourceForge page of wxFormBuilder.

    For Mac, I do not have first-hand experience but you can try downloading version 3.1 from the regular build page.