【问题标题】:How can I enable syntax highlighting, auto-complete etc. for GTK4 in python?如何在 python 中为 GTK4 启用语法突出显示、自动完成等?
【发布时间】:2022-12-16 00:41:10
【问题描述】:

我正在使用 Visual Studio Code,我正在尝试使用 python 在 GTK4 中开发我的第一个应用程序。到目前为止,我设法做了一些事情,但没有 IDE 的帮助,因为我尝试从 GTK 调用的所有东西都是白色的,并且类型为“Any”。

import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk


class Window(Gtk.ApplicationWindow):
  def __init__(self, app):
    #...
    hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=20) # everything as Any type, and no help from the IDE with syntax highlighting or autocomplete

我尝试寻找带有“GTK”和“GTK Python”等关键字的 vs 扩展,但它们似乎都不是我需要的。

那么,有什么方法可以在 python 中语法高亮/自动完成 GTK 库吗?

【问题讨论】:

    标签: python visual-studio-code ide gtk


    【解决方案1】:

    主要是扩展名

    1. vscode-python

    【讨论】:

      猜你喜欢
      • 2011-04-11
      • 1970-01-01
      • 2015-03-30
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多