def start_pymol(): # PyMOL launched as "python pymol/__init__.py" # or via execfile(".../pymol/__init__.py",...) from main # or as "python -m pymol.__init__" if 'pymol' not in sys.modules: # "python /abc/pymol/__init__.py" will add /abc/pymol to PYTHONPATH # (we don't want that), but not /abc and not the current directory (we # want those) pymol_base = os.path.dirname(os.path.realpath(__file__)) site_packages = os.path.dirname(pymol_base) # remove /abc/pymol if pymol_base in sys.path: sys.path.remove(pymol_base) # add /abc if site_packages not in sys.path: sys.path.insert(0, site_packages) # add current directory if '' not in sys.path: sys.path.insert(0, '') # arguments default to sys.argv... but also support execfile(...) # from a terminal where the user could set pymol_argv args = getattr(__main__, "pymol_argv", None) # standard launch (consume main thread) import pymol sys.exit(pymol.launch(args))
# add /abc if site_packages not in sys.path: sys.path.insert(0, site_packages) # add current directory if '' not in sys.path: sys.path.insert(0, '') # arguments default to sys.argv... but also support execfile(...) # from a terminal where the user could set pymol_argv args = getattr(__main__, "pymol_argv", None) # standard launch (consume main thread) import pymol sys.exit(pymol.launch(args)) IS_WINDOWS = sys.platform.startswith('win') IS_MACOS = sys.platform.startswith('darwin') IS_LINUX = sys.platform.startswith('linux') import _thread as thread import copy import threading import re import time import traceback import math from . import invocation
# add /abc if site_packages not in sys.path: sys.path.insert(0, site_packages) # add current directory if '' not in sys.path: sys.path.insert(0, '') # arguments default to sys.argv... but also support execfile(...) # from a terminal where the user could set pymol_argv args = getattr(__main__, "pymol_argv", None) # standard launch (consume main thread) import pymol pymol.launch(args) # this should never be reached because PyMOL will exit the process raise SystemExit IS_PY2 = sys.version_info[0] == 2 IS_PY3 = sys.version_info[0] == 3 IS_WINDOWS = sys.platform.startswith('win') IS_MACOS = sys.platform.startswith('darwin') IS_LINUX = sys.platform.startswith('linux') if IS_PY3: import _thread as thread else: import thread
''' PyMOL Molecular Graphics System Copyright (c) Schrodinger, Inc. ''' import sys if __name__ == '__main__': import pymol sys.exit(pymol.launch())
# -*- coding: utf-8 -*- import re import sys from pymol import launch if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(launch())
''' PyMOL Molecular Graphics System Copyright (c) Schrodinger, Inc. ''' if __name__ == '__main__': import pymol pymol.launch()
''' PyMOL Molecular Graphics System Copyright (c) Schrodinger, Inc. ''' from __future__ import absolute_import if __name__ == '__main__': import pymol pymol.launch()