How to integrate SimpleGUI with Python 2.7 and 3.0 shell

前端 未结 7 1158
灰色年华
灰色年华 2020-12-08 05:19

I am learning Python from Coursera. In this course they use SimpleGUI module on CodeSkulptor. Can anyone tell me how to integrate SimpleGUI with python 2.7

7条回答
  •  鱼传尺愫
    2020-12-08 05:38

    You can use my

    enter image description here SimpleGUICS2Pygame package.

    Objectively, this is the best solution :-)

    The package implement simplegui, codeskulptor, numeric and simpleplot modules.

    If your Python tools are up to date, it is easy to install:

    python -m pip install SimpleGUICS2Pygame --user --upgrade
    
    • Online HTML documentation: https://simpleguics2pygame.readthedocs.io/
      • Installation: https://simpleguics2pygame.readthedocs.io/en/latest/#installation
    • Sources: https://bitbucket.org/OPiMedia/simpleguics2pygame

    In your code, replace the import command

    import simplegui
    

    by

    try:
        import simplegui
    except ImportError:
        import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
    

    and your code run in CodeSkulptor and in standard Python (2 and 3) with this package.

    Note that:

    • SimpleGUITk is an other implementation, using Tkinter and some others packages. It is really less complete and not updated. However it works for some programs.
    • simplegui is a Python package which has the same name as SimpleGUI of CodeSkulptor, but it is totally something else.

提交回复
热议问题