系统:15.10(Wily Werewolf)x64
码:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(400, 300)
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(120, 120, 85, 26))
self.pushButton.setObjectName("pushButton")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.pushButton.setText(_translate("Form", "PushButton"))
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ex …Run Code Online (Sandbox Code Playgroud) 给定 Django 视图函数中的对象列表,例如
[['1.1.1.1', A], ['2.2.2.2', B]]
Run Code Online (Sandbox Code Playgroud)
如何在 html 模板中迭代它们以生成表格行
Column1 Column2
1.1.1.1 A
2.2.2.2 B
Run Code Online (Sandbox Code Playgroud)
如果您有不同的方法来做到这一点,通过以不同的方式创建数组/列表(没有对象,但例如元素列表,请随意分享)。