本文整理汇总了Python中spyderlib.qt.QtCore.QTextCodec类的典型用法代码示例。如果您正苦于以下问题:Python QTextCodec类的具体用法?Python QTextCodec怎么用?Python QTextCodec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QTextCodec类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: import
Profiler widget
See the official documentation on python profiling:
http://docs.python.org/library/profile.html
Questions for Pierre and others:
- Where in the menu should profiler go? Run > Profile code ?
"""
from __future__ import with_statement
from spyderlib.qt.QtGui import (QHBoxLayout, QWidget, QMessageBox, QVBoxLayout,
QLabel, QTreeWidget, QTreeWidgetItem,
QApplication)
from spyderlib.qt.QtCore import SIGNAL, QProcess, QByteArray, Qt, QTextCodec
locale_codec = QTextCodec.codecForLocale()
from spyderlib.qt.compat import getopenfilename
import sys
import os
import os.path as osp
import time
# Local imports
from spyderlib.utils.qthelpers import (create_toolbutton, get_item_user_text,
set_item_user_text, get_icon)
from spyderlib.utils.programs import shell_split
from spyderlib.baseconfig import get_conf_path, get_translation
from spyderlib.widgets.texteditor import TextEditor
from spyderlib.widgets.comboboxes import PythonModulesComboBox
from spyderlib.widgets.externalshell import baseshell
示例2: add_pathlist_to_PYTHONPATH
# (see spyderlib/__init__.py for details)
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
import os
import os.path as osp
from time import time, strftime, gmtime
from spyderlib.qt.QtGui import QWidget, QVBoxLayout, QHBoxLayout, QMenu, QLabel, QInputDialog, QLineEdit, QToolButton
from spyderlib.qt.QtCore import QProcess, Signal, QByteArray, QTimer, Qt, QTextCodec, Slot
import spyderlib.utils.icon_manager as ima
LOCALE_CODEC = QTextCodec.codecForLocale()
# Local imports
from spyderlib.utils.qthelpers import create_toolbutton, create_action, add_actions
from spyderlib.config.base import get_conf_path, _
from spyderlib.py3compat import is_text_string, to_text_string
def add_pathlist_to_PYTHONPATH(env, pathlist, drop_env=False):
# PyQt API 1/2 compatibility-related tests:
assert isinstance(env, list)
assert all([is_text_string(path) for path in env])
pypath = "PYTHONPATH"
pathstr = os.pathsep.join(pathlist)
if os.environ.get(pypath) is not None and not drop_env:
示例3: ExternalSystemShell
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""External System Shell widget: execute terminal in a separate process"""
import os
from spyderlib.qt.QtGui import QMessageBox
from spyderlib.qt.QtCore import QProcess, Signal, QTextCodec, QProcessEnvironment
LOCALE_CODEC = QTextCodec.codecForLocale()
CP850_CODEC = QTextCodec.codecForName("cp850")
# Local imports
from spyderlib.utils.programs import shell_split
from spyderlib.baseconfig import _
from spyderlib.widgets.externalshell.baseshell import ExternalShellBase, add_pathlist_to_PYTHONPATH
from spyderlib.widgets.shell import TerminalWidget
from spyderlib.py3compat import to_text_string, is_text_string
import spyderlib.utils.icon_manager as ima
class ExternalSystemShell(ExternalShellBase):
"""External Shell widget: execute Python script in a separate process"""
SHELL_CLASS = TerminalWidget
started = Signal()