當前位置: 首頁>>代碼示例>>Python>>正文


Python sys.copyright方法代碼示例

本文整理匯總了Python中sys.copyright方法的典型用法代碼示例。如果您正苦於以下問題:Python sys.copyright方法的具體用法?Python sys.copyright怎麽用?Python sys.copyright使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sys的用法示例。


在下文中一共展示了sys.copyright方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    __builtin__.copyright = _Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        __builtin__.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    elif sys.platform == 'cli':
        __builtin__.credits = _Printer(
            "credits",
            "IronPython is maintained by the IronPython developers (www.ironpython.net).")
    else:
        __builtin__.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    __builtin__.license = _Printer(
        "license", "See http://www.python.org/%.3s/license.html" % sys.version,
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:22,代碼來源:site.py

示例2: OnInitDialog

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def OnInitDialog(self):
		text = "Pythonwin - Python IDE and GUI Framework for Windows.\n\n%s\n\nPython is %s\n\n%s\n\n%s\n\n%s" % (win32ui.copyright, sys.copyright, scintilla, idle, contributors)
		self.SetDlgItemText(win32ui.IDC_EDIT1, text)
		# Get the build number - written by installers.
		# For distutils build, read pywin32.version.txt
		import distutils.sysconfig
		site_packages = distutils.sysconfig.get_python_lib(plat_specific=1)
		try:
			build_no = open(os.path.join(site_packages, "pywin32.version.txt")).read().strip()
			ver = "pywin32 build %s" % build_no
		except EnvironmentError:
			ver = None
		if ver is None:
			# See if we are Part of Active Python
			ver = _GetRegistryValue("SOFTWARE\\ActiveState\\ActivePython", "CurrentVersion")
			if ver is not None:
				ver = "ActivePython build %s" % (ver,)
		if ver is None:
			ver = ""
		self.SetDlgItemText(win32ui.IDC_ABOUT_VERSION, ver)
		self.HookCommand(self.OnButHomePage, win32ui.IDC_BUTTON1) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:23,代碼來源:app.py

示例3: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    __builtin__.copyright = _Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        __builtin__.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    elif sys.platform == 'cli':
        __builtin__.credits = _Printer(
            "credits",
            "IronPython is maintained by the IronPython developers (www.ironpython.net).")
    else:
        __builtin__.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    __builtin__.license = _Printer(
        "license", "See https://www.python.org/psf/license/",
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:22,代碼來源:site.py

示例4: test_reload_sys

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def test_reload_sys(self):
        import sys
        
        (old_copyright, old_byteorder) = (sys.copyright, sys.byteorder)
        (sys.copyright, sys.byteorder) = ("foo", "foo")
        
        (old_argv, old_exc_type) = (sys.argv, sys.exc_type)
        (sys.argv, sys.exc_type) = ("foo", "foo")
        
        reloaded_sys = reload(sys)
        
        # Most attributes get reset
        self.assertEqual((old_copyright, old_byteorder), (reloaded_sys.copyright, reloaded_sys.byteorder))
        # Some attributes are not reset
        self.assertEqual((reloaded_sys.argv, reloaded_sys.exc_type), ("foo", "foo"))
        # Put back the original values
        (sys.copyright, sys.byteorder) = (old_copyright, old_byteorder)
        (sys.argv, sys.exc_type) = (old_argv, old_exc_type) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:20,代碼來源:test_isinstance.py

示例5: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    builtins.copyright = _Printer("copyright", sys.copyright)
    if _is_jython:
        builtins.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    elif _is_pypy:
        builtins.credits = _Printer(
            "credits",
            "PyPy is maintained by the PyPy developers: http://pypy.org/")
    else:
        builtins.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    builtins.license = _Printer(
        "license", "See http://www.python.org/%.3s/license.html" % sys.version,
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:awemulya,項目名稱:kobo-predict,代碼行數:22,代碼來源:site.py

示例6: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    __builtin__.copyright = _Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        __builtin__.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    else:
        __builtin__.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    __builtin__.license = _Printer(
        "license", "See http://www.python.org/%.3s/license.html" % sys.version,
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:dxwu,項目名稱:BinderFilter,代碼行數:18,代碼來源:site.py

示例7: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    __builtin__.copyright = _Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        __builtin__.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    else:
        __builtin__.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    __builtin__.license = _Printer(
        "license", "See http://www.python.org/psf/license/",
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:18,代碼來源:site.py

示例8: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    builtins.copyright = _Printer("copyright", sys.copyright)
    if _is_jython:
        builtins.credits = _Printer("credits", "Jython is maintained by the Jython developers (www.jython.org).")
    elif _is_pypy:
        builtins.credits = _Printer("credits", "PyPy is maintained by the PyPy developers: http://pypy.org/")
    else:
        builtins.credits = _Printer(
            "credits",
            """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""",
        )
    here = os.path.dirname(os.__file__)
    builtins.license = _Printer(
        "license",
        "See https://www.python.org/psf/license/",
        ["LICENSE.txt", "LICENSE"],
        [sys.prefix, os.path.join(here, os.pardir), here, os.curdir],
    ) 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:23,代碼來源:site.py

示例9: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in builtins"""
    builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        builtins.credits = _sitebuiltins._Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    else:
        builtins.credits = _sitebuiltins._Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    files, dirs = [], []
    # Not all modules are required to have a __file__ attribute.  See
    # PEP 420 for more details.
    if hasattr(os, '__file__'):
        here = os.path.dirname(os.__file__)
        files.extend(["LICENSE.txt", "LICENSE"])
        dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
    builtins.license = _sitebuiltins._Printer(
        "license",
        "See https://www.python.org/psf/license/",
        files, dirs) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:24,代碼來源:site.py

示例10: test_reload_sys

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def test_reload_sys(self):
        import imp
        import sys

        (old_copyright, old_byteorder) = (sys.copyright, sys.byteorder)
        (sys.copyright, sys.byteorder) = ("foo", "foo")

        old_argv = sys.argv
        sys.argv = "foo"

        reloaded_sys = imp.reload(sys)

        # Most attributes get reset
        self.assertEqual((old_copyright, old_byteorder), (reloaded_sys.copyright, reloaded_sys.byteorder))
        # Some attributes are not reset
        self.assertEqual(reloaded_sys.argv, "foo")
        # Put back the original values
        (sys.copyright, sys.byteorder) = (old_copyright, old_byteorder)
        sys.argv = old_argv 
開發者ID:IronLanguages,項目名稱:ironpython3,代碼行數:21,代碼來源:test_isinstance.py

示例11: setcopyright

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def setcopyright():
    """Set 'copyright' and 'credits' in __builtin__"""
    __builtin__.copyright = _Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        __builtin__.credits = _Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    else:
        __builtin__.credits = _Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    here = os.path.dirname(os.__file__)
    __builtin__.license = _Printer(
        "license", "See https://www.python.org/psf/license/",
        ["LICENSE.txt", "LICENSE"],
        [os.path.join(here, os.pardir), here, os.curdir]) 
開發者ID:nccgroup,項目名稱:Splunking-Crime,代碼行數:18,代碼來源:site.py

示例12: test_attributes

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import copyright [as 別名]
def test_attributes(self):
        if not test.test_support.is_jython:
            self.assert_(isinstance(sys.api_version, int))
        self.assert_(isinstance(sys.argv, list))
        self.assert_(sys.byteorder in ("little", "big"))
        self.assert_(isinstance(sys.builtin_module_names, tuple))
        self.assert_(isinstance(sys.copyright, basestring))
        self.assert_(isinstance(sys.exec_prefix, basestring))
        self.assert_(isinstance(sys.executable, basestring))
        self.assert_(isinstance(sys.hexversion, int))
        self.assert_(isinstance(sys.maxint, int))
        self.assert_(isinstance(sys.maxunicode, int))
        self.assert_(isinstance(sys.platform, basestring))
        self.assert_(isinstance(sys.prefix, basestring))
        self.assert_(isinstance(sys.version, basestring))
        vi = sys.version_info
        self.assert_(isinstance(vi, tuple))
        self.assertEqual(len(vi), 5)
        self.assert_(isinstance(vi[0], int))
        self.assert_(isinstance(vi[1], int))
        self.assert_(isinstance(vi[2], int))
        self.assert_(vi[3] in ("alpha", "beta", "candidate", "final"))
        self.assert_(isinstance(vi[4], int)) 
開發者ID:ofermend,項目名稱:medicare-demo,代碼行數:25,代碼來源:test_sys.py


注:本文中的sys.copyright方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。