Exemplo n.º 1
0
def main():
    GUIUSE = True

    try:
        if EMAN2.get_platform() == "Linux" and os.getenv("DISPLAY") == None:
            raise Exception

        # import IPython.lib.inputhook

        app = eman2_gui.emapplication.EMApp()
        # IPython.lib.inputhook.enable_qt4(app)

        def ipy_on_timer():
            eman2_gui.emimage.image_update()

        ipytimer = PyQt5.QtCore.QTimer()
        ipytimer.timeout.connect(ipy_on_timer)
        ipytimer.start(200)

        EMAN2.GUIMode = True
        EMAN2.app = app
    except:
        GUIUSE = False


    if GUIUSE:
        print("Welcome to the interactive SPARX-GUI Python interface, provided by ipython")
    else:
        print(
            "Welcome to the interactive SPARX-NoGUI Python interface, provided by ipython"
        )

    print("  ", sp_global_def.SPARXVERSION)
Exemplo n.º 2
0
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  2111-1307 USA
#
#

import EMAN2
import PyQt5
import eman2_gui.emapplication
import eman2_gui.emimage
import os
import sp_global_def

GUIUSE = True

try:
    if EMAN2.get_platform() == "Linux" and os.getenv("DISPLAY") == None:
        raise Exception

    # import IPython.lib.inputhook

    app = eman2_gui.emapplication.EMApp()
    # IPython.lib.inputhook.enable_qt4(app)

    def ipy_on_timer():
        eman2_gui.emimage.image_update()

    ipytimer = PyQt5.QtCore.QTimer()
    ipytimer.timeout.connect(ipy_on_timer)
    ipytimer.start(200)

    EMAN2.GUIMode = True