PyKDE 编程/KDE
外观
< PyKDE 编程
从现在开始你将要编写的每个 KDE 应用程序都将包含以下大部分代码。
#!/usr/bin/python
import sys
from PyKDE4.kdecore import ki18n, KCmdLineArgs, KAboutData
from PyKDE4.kdeui import KApplication
appName = "kde-application"
catalog = "simple test"
programName = ki18n("KDE Application")
version = "1.0"
aboutData = KAboutData(appName, catalog, programName, version)
KCmdLineArgs.init (sys.argv, aboutData)
app = KApplication ()
# your main widget (the application window) would be created and shown here
sys.exit(app.exec_())
继续,运行这个文件。程序将加载,并且直到你终止它才会结束。
接下来我们将学习如何添加第一个小部件。