1. python是如何写界面程序的
2. 用python 如何写一个桌面程序,求详细步骤
是要写图形界面的程序吗?
想要写图形界面可以使用自带的tkinter库
from tkinter import *
r = Tk()
l= Label(root,text = 'hello')
# 使用绝对坐标将Label放置到(0,0)位置上
l.place(x = 0,y = 0,anchor = NW)以上是我在另一个回答中的代码。
也有很多第三方的库比如主流的PyQt、wxPython
也有学习用的simpleGUI
包装Windows MFC的pythonwin
说白了其实就是学习界面库
3. python是如何写界面程序的
python做界面还是用PYQT吧 PYQT支持PY2和e69da5e6ba90e799bee5baa631333332626663PY3 wxpython仅仅支持PY2 而python自带的tkinter实在是很难弄 #!/usr/bin/python# -*- coding: utf-8 -*-# slider.pyimport sysfrom PyQt4 import QtGuifrom PyQt4 import QtCoreclass Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): slider = QtGui.QSlider(QtCore.Qt.Horizontal, self) slider.setFocusPolicy(QtCore.Qt.NoFocus) slider.setGeometry(30, 40, 100, 30) self.connect(slider, QtCore.SIGNAL('valueChanged(int)'), self.changeValue) self.label = QtGui.QLabel(self) self.label.setPixmap(QtGui.QPixmap('mute.png')) self.label.setGeometry(160, 40, 80, 30) self.setWindowTitle('Slider') self.setGeometry(300, 300, 250, 150) def changeValue(self, value): if value == 0: self.label.setPixmap(QtGui.QPixmap('mute.png')) elif value > 0 and value <= 30: self.label.setPixmap(QtGui.QPixmap('min.png')) elif value > 30 and value < 80: self.label.setPixmap(QtGui.QPixmap('med.png')) else: self.label.setPixmap(QtGui.QPixmap('max.png'))if __name__ == '__main__': app = QtGui.QApplication(sys.argv) ex = Example() ex.show() app.exec_()。