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


Python CompleteStyle.MULTI_COLUMN屬性代碼示例

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


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

示例1: main

# 需要導入模塊: from prompt_toolkit.shortcuts import CompleteStyle [as 別名]
# 或者: from prompt_toolkit.shortcuts.CompleteStyle import MULTI_COLUMN [as 別名]
def main():
    # Simple completion menu.
    print("(The completion menu displays colors.)")
    prompt("Type an animal: ", completer=AnimalCompleter())

    # Multi-column menu.
    prompt(
        "Type an animal: ",
        completer=AnimalCompleter(),
        complete_style=CompleteStyle.MULTI_COLUMN,
    )

    # Readline-like
    prompt(
        "Type an animal: ",
        completer=AnimalCompleter(),
        complete_style=CompleteStyle.READLINE_LIKE,
    ) 
開發者ID:prompt-toolkit,項目名稱:python-prompt-toolkit,代碼行數:20,代碼來源:colored-completions-with-formatted-text.py

示例2: main

# 需要導入模塊: from prompt_toolkit.shortcuts import CompleteStyle [as 別名]
# 或者: from prompt_toolkit.shortcuts.CompleteStyle import MULTI_COLUMN [as 別名]
def main():
    # Simple completion menu.
    print("(The completion menu displays colors.)")
    prompt("Type a color: ", completer=FuzzyCompleter(ColorCompleter()))

    # Multi-column menu.
    prompt(
        "Type a color: ",
        completer=FuzzyCompleter(ColorCompleter()),
        complete_style=CompleteStyle.MULTI_COLUMN,
    )

    # Readline-like
    prompt(
        "Type a color: ",
        completer=FuzzyCompleter(ColorCompleter()),
        complete_style=CompleteStyle.READLINE_LIKE,
    ) 
開發者ID:prompt-toolkit,項目名稱:python-prompt-toolkit,代碼行數:20,代碼來源:fuzzy-custom-completer.py

示例3: main

# 需要導入模塊: from prompt_toolkit.shortcuts import CompleteStyle [as 別名]
# 或者: from prompt_toolkit.shortcuts.CompleteStyle import MULTI_COLUMN [as 別名]
def main():
    text = prompt(
        "Give some animals: ",
        completer=animal_completer,
        complete_style=CompleteStyle.MULTI_COLUMN,
    )
    print("You said: %s" % text) 
開發者ID:prompt-toolkit,項目名稱:python-prompt-toolkit,代碼行數:9,代碼來源:multi-column-autocompletion-with-meta.py

示例4: main

# 需要導入模塊: from prompt_toolkit.shortcuts import CompleteStyle [as 別名]
# 或者: from prompt_toolkit.shortcuts.CompleteStyle import MULTI_COLUMN [as 別名]
def main():
    # Simple completion menu.
    print("(The completion menu displays colors.)")
    prompt("Type a color: ", completer=ColorCompleter())

    # Multi-column menu.
    prompt(
        "Type a color: ",
        completer=ColorCompleter(),
        complete_style=CompleteStyle.MULTI_COLUMN,
    )

    # Readline-like
    prompt(
        "Type a color: ",
        completer=ColorCompleter(),
        complete_style=CompleteStyle.READLINE_LIKE,
    )

    # Prompt with true color output.
    message = [
        ("#cc2244", "T"),
        ("#bb4444", "r"),
        ("#996644", "u"),
        ("#cc8844", "e "),
        ("#ccaa44", "C"),
        ("#bbaa44", "o"),
        ("#99aa44", "l"),
        ("#778844", "o"),
        ("#55aa44", "r "),
        ("#33aa44", "p"),
        ("#11aa44", "r"),
        ("#11aa66", "o"),
        ("#11aa88", "m"),
        ("#11aaaa", "p"),
        ("#11aacc", "t"),
        ("#11aaee", ": "),
    ]
    prompt(message, completer=ColorCompleter(), color_depth=ColorDepth.TRUE_COLOR) 
開發者ID:prompt-toolkit,項目名稱:python-prompt-toolkit,代碼行數:41,代碼來源:colored-completions.py


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