python3+PyQt5 使用三种不同的简便项窗口部件显示数据的方法


Posted in Python onJune 17, 2019

本文通过将同一个数据集在三种不同的简便项窗口部件中显示。三个窗口的数据得到实时的同步,数据和视图分离。当添加或删除数据行,三个不同的视图均保持同步。数据将保存在本地文件中,而非数据库。对于小型和临时性数据集来说,这些简便窗口部件非常有用,可以用在非单独数据集中-数据自身的显示,编辑和存储。

所使用的数据集:

/home/yrd/eric_workspace/chap14/ships_conv/ships.py

#!/usr/bin/env python3

import platform
from PyQt5.QtCore import QDataStream, QFile,QIODevice,Qt
from PyQt5.QtWidgets import QApplication
NAME, OWNER, COUNTRY, DESCRIPTION, TEU = range(5)

MAGIC_NUMBER = 0x570C4
FILE_VERSION = 1


class Ship(object):

  def __init__(self, name, owner, country, teu=0, description=""):
    self.name = name
    self.owner = owner
    self.country = country
    self.teu = teu
    self.description = description


  def __hash__(self):
    return super(Ship, self).__hash__()


  def __lt__(self, other):
    return bool(self.name.lower()<other.name.lower())


  def __eq__(self, other):
    return bool(self.name.lower()==other.name.lower())


class ShipContainer(object):

  def __init__(self, filename=""):
    self.filename = filename
    self.dirty = False
    self.ships = {}
    self.owners = set()
    self.countries = set()


  def ship(self, identity):
    return self.ships.get(identity)


  def addShip(self, ship):
    self.ships[id(ship)] = ship
    self.owners.add(str(ship.owner))
    self.countries.add(str(ship.country))
    self.dirty = True


  def removeShip(self, ship):
    del self.ships[id(ship)]
    del ship
    self.dirty = True


  def __len__(self):
    return len(self.ships)


  def __iter__(self):
    for ship in self.ships.values():
      yield ship


  def inOrder(self):
    return sorted(self.ships.values())


  def inCountryOwnerOrder(self):
    return sorted(self.ships.values(),
           key=lambda x: (x.country, x.owner, x.name))


  def load(self):
    exception = None
    fh = None
    try:
      if not self.filename:
        raise IOError("no filename specified for loading")
      fh = QFile(self.filename)
      if not fh.open(QIODevice.ReadOnly):
        raise IOError(str(fh.errorString()))
      stream = QDataStream(fh)
      magic = stream.readInt32()
      if magic != MAGIC_NUMBER:
        raise IOError("unrecognized file type")
      fileVersion = stream.readInt16()
      if fileVersion != FILE_VERSION:
        raise IOError("unrecognized file type version")
      self.ships = {}
      while not stream.atEnd():
        name = ""
        owner = ""
        country = ""
        description = ""
        name=stream.readQString()
        owner=stream.readQString()
        country=stream.readQString()
        description=stream.readQString()
        teu = stream.readInt32()
        ship = Ship(name, owner, country, teu, description)
        self.ships[id(ship)] = ship
        self.owners.add(str(owner))
        self.countries.add(str(country))
      self.dirty = False
    except IOError as e:
      exception = e
    finally:
      if fh is not None:
        fh.close()
      if exception is not None:
        raise exception


  def save(self):
    exception = None
    fh = None
    try:
      if not self.filename:
        raise IOError("no filename specified for saving")
      fh = QFile(self.filename)
      if not fh.open(QIODevice.WriteOnly):
        raise IOError(str(fh.errorString()))
      stream = QDataStream(fh)
      stream.writeInt32(MAGIC_NUMBER)
      stream.writeInt16(FILE_VERSION)
      stream.setVersion(QDataStream.Qt_5_7)
      for ship in self.ships.values():
        stream.writeQString(ship.name)
        stream.writeQString(ship.owner)
        stream.writeQString(ship.country)
        stream.writeQString(ship.description)
        stream.writeInt32(ship.teu)
      self.dirty = False
    except IOError as e:
      exception = e
    finally:
      if fh is not None:
        fh.close()
      if exception is not None:
        raise exception



def generateFakeShips():
  for name, owner, country, teu, description in (
("Emma M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 151687,
 "<b>W\u00E4rtsil\u00E4-Sulzer RTA96-C</b> main engine,"
 "<font color=green>109,000 hp</font>"),
("MSC Pamela", "MSC", "Liberia", 90449,
 "Draft <font color=green>15m</font>"),
("Colombo Express", "Hapag-Lloyd", "Germany", 93750,
 "Main engine, <font color=green>93,500 hp</font>"),
("Houston Express", "Norddeutsche Reederei", "Germany", 95000,
 "Features a <u>twisted leading edge full spade rudder</u>. "
 "Sister of <i>Savannah Express</i>"),
("Savannah Express", "Norddeutsche Reederei", "Germany", 95000,
 "Sister of <i>Houston Express</i>"),
("MSC Susanna", "MSC", "Liberia", 90449, ""),
("Eleonora M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 151687,
 "Captain <i>Hallam</i>"),
("Estelle M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 151687,
 "Captain <i>Wells</i>"),
("Evelyn M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 151687,
 "Captain <i>Byrne</i>"),
("Georg M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("Gerd M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("Gjertrud M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("Grete M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("Gudrun M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("Gunvor M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 97933, ""),
("CSCL Le Havre", "Danaos Shipping", "Cyprus", 107200, ""),
("CSCL Pusan", "Danaos Shipping", "Cyprus", 107200,
 "Captain <i>Watts</i>"),
("Xin Los Angeles", "China Shipping Container Lines (CSCL)",
 "Hong Kong", 107200, ""),
("Xin Shanghai", "China Shipping Container Lines (CSCL)", "Hong Kong",
 107200, ""),
("Cosco Beijing", "Costamare Shipping", "Greece", 99833, ""),
("Cosco Hellas", "Costamare Shipping", "Greece", 99833, ""),
("Cosco Guangzho", "Costamare Shipping", "Greece", 99833, ""),
("Cosco Ningbo", "Costamare Shipping", "Greece", 99833, ""),
("Cosco Yantian", "Costamare Shipping", "Greece", 99833, ""),
("CMA CGM Fidelio", "CMA CGM", "France", 99500, ""),
("CMA CGM Medea", "CMA CGM", "France", 95000, ""),
("CMA CGM Norma", "CMA CGM", "Bahamas", 95000, ""),
("CMA CGM Rigoletto", "CMA CGM", "France", 99500, ""),
("Arnold M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496,
 "Captain <i>Morrell</i>"),
("Anna M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496,
 "Captain <i>Lockhart</i>"),
("Albert M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496,
 "Captain <i>Tallow</i>"),
("Adrian M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496,
 "Captain <i>G. E. Ericson</i>"),
("Arthur M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496, ""),
("Axel M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 93496, ""),
("NYK Vega", "Nippon Yusen Kaisha", "Panama", 97825, ""),
("MSC Esthi", "MSC", "Liberia", 99500, ""),
("MSC Chicago", "Offen Claus-Peter", "Liberia", 90449, ""),
("MSC Bruxelles", "Offen Claus-Peter", "Liberia", 90449, ""),
("MSC Roma", "Offen Claus-Peter", "Liberia", 99500, ""),
("MSC Madeleine", "MSC", "Liberia", 107551, ""),
("MSC Ines", "MSC", "Liberia", 107551, ""),
("Hannover Bridge", "Kawasaki Kisen Kaisha", "Japan", 99500, ""),
("Charlotte M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Clementine M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Columbine M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Cornelia M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Chicago Express", "Hapag-Lloyd", "Germany", 93750, ""),
("Kyoto Express", "Hapag-Lloyd", "Germany", 93750, ""),
("Clifford M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Sally M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Sine M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Skagen M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Sofie M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Sor\u00F8 M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Sovereing M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Susan M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Svend M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Svendborg M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("A.P. M\u00F8ller", "M\u00E6rsk Line", "Denmark", 91690,
 "Captain <i>Ferraby</i>"),
("Caroline M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Carsten M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Chastine M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("Cornelius M\u00E6rsk", "M\u00E6rsk Line", "Denmark", 91690, ""),
("CMA CGM Otello", "CMA CGM", "France", 91400, ""),
("CMA CGM Tosca", "CMA CGM", "France", 91400, ""),
("CMA CGM Nabucco", "CMA CGM", "France", 91400, ""),
("CMA CGM La Traviata", "CMA CGM", "France", 91400, ""),
("CSCL Europe", "Danaos Shipping", "Cyprus", 90645, ""),
("CSCL Africa", "Seaspan Container Line", "Cyprus", 90645, ""),
("CSCL America", "Danaos Shipping ", "Cyprus", 90645, ""),
("CSCL Asia", "Seaspan Container Line", "Hong Kong", 90645, ""),
("CSCL Oceania", "Seaspan Container Line", "Hong Kong", 90645,
 "Captain <i>Baker</i>"),
("M\u00E6rsk Seville", "Blue Star GmbH", "Liberia", 94724, ""),
("M\u00E6rsk Santana", "Blue Star GmbH", "Liberia", 94724, ""),
("M\u00E6rsk Sheerness", "Blue Star GmbH", "Liberia", 94724, ""),
("M\u00E6rsk Sarnia", "Blue Star GmbH", "Liberia", 94724, ""),
("M\u00E6rsk Sydney", "Blue Star GmbH", "Liberia", 94724, ""),
("MSC Heidi", "MSC", "Panama", 95000, ""),
("MSC Rania", "MSC", "Panama", 95000, ""),
("MSC Silvana", "MSC", "Panama", 95000, ""),
("M\u00E6rsk Stralsund", "Blue Star GmbH", "Liberia", 95000, ""),
("M\u00E6rsk Saigon", "Blue Star GmbH", "Liberia", 95000, ""),
("M\u00E6rsk Seoul", "Blue Star Ship Managment GmbH", "Germany",
 95000, ""),
("M\u00E6rsk Surabaya", "Offen Claus-Peter", "Germany", 98400, ""),
("CMA CGM Hugo", "NSB Niederelbe", "Germany", 90745, ""),
("CMA CGM Vivaldi", "CMA CGM", "Bahamas", 90745, ""),
("MSC Rachele", "NSB Niederelbe", "Germany", 90745, ""),
("Pacific Link", "NSB Niederelbe", "Germany", 90745, ""),
("CMA CGM Carmen", "E R Schiffahrt", "Liberia", 89800, ""),
("CMA CGM Don Carlos", "E R Schiffahrt", "Liberia", 89800, ""),
("CMA CGM Don Giovanni", "E R Schiffahrt", "Liberia", 89800, ""),
("CMA CGM Parsifal", "E R Schiffahrt", "Liberia", 89800, ""),
("Cosco China", "E R Schiffahrt", "Liberia", 91649, ""),
("Cosco Germany", "E R Schiffahrt", "Liberia", 89800, ""),
("Cosco Napoli", "E R Schiffahrt", "Liberia", 89800, ""),
("YM Unison", "Yang Ming Line", "Taiwan", 88600, ""),
("YM Utmost", "Yang Ming Line", "Taiwan", 88600, ""),
("MSC Lucy", "MSC", "Panama", 89954, ""),
("MSC Maeva", "MSC", "Panama", 89954, ""),
("MSC Rita", "MSC", "Panama", 89954, ""),
("MSC Busan", "Offen Claus-Peter", "Panama", 89954, ""),
("MSC Beijing", "Offen Claus-Peter", "Panama", 89954, ""),
("MSC Toronto", "Offen Claus-Peter", "Panama", 89954, ""),
("MSC Charleston", "Offen Claus-Peter", "Panama", 89954, ""),
("MSC Vittoria", "MSC", "Panama", 89954, ""),
("Ever Champion", "NSB Niederelbe", "Marshall Islands", 90449,
 "Captain <i>Phillips</i>"),
("Ever Charming", "NSB Niederelbe", "Marshall Islands", 90449,
 "Captain <i>Tonbridge</i>"),
("Ever Chivalry", "NSB Niederelbe", "Marshall Islands", 90449, ""),
("Ever Conquest", "NSB Niederelbe", "Marshall Islands", 90449, ""),
("Ital Contessa", "NSB Niederelbe", "Marshall Islands", 90449, ""),
("Lt Cortesia", "NSB Niederelbe", "Marshall Islands", 90449, ""),
("OOCL Asia", "OOCL", "Hong Kong", 89097, ""),
("OOCL Atlanta", "OOCL", "Hong Kong", 89000, ""),
("OOCL Europe", "OOCL", "Hong Kong", 89097, ""),
("OOCL Hamburg", "OOCL", "Marshall Islands", 89097, ""),
("OOCL Long Beach", "OOCL", "Marshall Islands", 89097, ""),
("OOCL Ningbo", "OOCL", "Marshall Islands", 89097, ""),
("OOCL Shenzhen", "OOCL", "Hong Kong", 89097, ""),
("OOCL Tianjin", "OOCL", "Marshall Islands", 89097, ""),
("OOCL Tokyo", "OOCL", "Hong Kong", 89097, "")):
    yield Ship(name, owner, country, teu, description)

/home/yrd/eric_workspace/chap14/ships_conv/ships-dict.pyw

#!/usr/bin/env python3

import sys
from PyQt5.QtCore import QFile, QTimer, Qt
from PyQt5.QtWidgets import (QApplication, QDialog, QHBoxLayout, QLabel,
    QListWidget, QListWidgetItem, QMessageBox, QPushButton,
    QSplitter, QTableWidget, QTableWidgetItem, QTreeWidget,
    QTreeWidgetItem, QVBoxLayout, QWidget)
import ships

MAC = True
try:
  from PyQt5.QtGui import qt_mac_set_native_menubar
except ImportError:
  MAC = False


class MainForm(QDialog):

  def __init__(self, parent=None):
    super(MainForm, self).__init__(parent)

    listLabel = QLabel("&List")
    self.listWidget = QListWidget()
    listLabel.setBuddy(self.listWidget)

    tableLabel = QLabel("&Table")
    self.tableWidget = QTableWidget()
    tableLabel.setBuddy(self.tableWidget)

    treeLabel = QLabel("Tre&e")
    self.treeWidget = QTreeWidget()
    treeLabel.setBuddy(self.treeWidget)

    addShipButton = QPushButton("&Add Ship")
    removeShipButton = QPushButton("&Remove Ship")
    quitButton = QPushButton("&Quit")
    if not MAC:
      addShipButton.setFocusPolicy(Qt.NoFocus)
      removeShipButton.setFocusPolicy(Qt.NoFocus)
      quitButton.setFocusPolicy(Qt.NoFocus)

    splitter = QSplitter(Qt.Horizontal)
    vbox = QVBoxLayout()
    vbox.addWidget(listLabel)
    vbox.addWidget(self.listWidget)
    widget = QWidget()
    widget.setLayout(vbox)
    splitter.addWidget(widget)
    vbox = QVBoxLayout()
    vbox.addWidget(tableLabel)
    vbox.addWidget(self.tableWidget)
    widget = QWidget()
    widget.setLayout(vbox)
    splitter.addWidget(widget)
    vbox = QVBoxLayout()
    vbox.addWidget(treeLabel)
    vbox.addWidget(self.treeWidget)
    widget = QWidget()
    widget.setLayout(vbox)
    splitter.addWidget(widget)
    buttonLayout = QHBoxLayout()
    buttonLayout.addWidget(addShipButton)
    buttonLayout.addWidget(removeShipButton)
    buttonLayout.addStretch()
    buttonLayout.addWidget(quitButton)
    layout = QVBoxLayout()
    layout.addWidget(splitter)
    layout.addLayout(buttonLayout)
    self.setLayout(layout)

    self.tableWidget.itemChanged[QTableWidgetItem].connect(self.tableItemChanged)
    addShipButton.clicked.connect(self.addShip)
    removeShipButton.clicked.connect(self.removeShip)
    quitButton.clicked.connect(self.accept)

    self.ships = ships.ShipContainer("ships.dat")
    self.setWindowTitle("Ships (dict)")
    QTimer.singleShot(0, self.initialLoad)


  def initialLoad(self):
    if not QFile.exists(self.ships.filename):
      for ship in ships.generateFakeShips():
        self.ships.addShip(ship)
      self.ships.dirty = False
    else:
      try:
        self.ships.load()
      except IOError as e:
        QMessageBox.warning(self, "Ships - Error",
            "Failed to load: {0}".format(e))
    self.populateList()
    self.populateTable()
    self.tableWidget.sortItems(0)
    self.populateTree()


  def reject(self):
    self.accept()


  def accept(self):
    if (self.ships.dirty and
      QMessageBox.question(self, "Ships - Save?",
          "Save unsaved changes?",
          QMessageBox.Yes|QMessageBox.No) ==
          QMessageBox.Yes):
      try:
        self.ships.save()
      except IOError as e:
        QMessageBox.warning(self, "Ships - Error",
            "Failed to save: {0}".format(e))
    QDialog.accept(self)


  def populateList(self, selectedShip=None):
    selected = None
    self.listWidget.clear()
    for ship in self.ships.inOrder():
      item = QListWidgetItem("{0} of {1}/{2} ({3:,})".format(ship.name,ship.owner,ship.country,int(ship.teu)))
      self.listWidget.addItem(item)
      if selectedShip is not None and selectedShip == id(ship):
        selected = item
    if selected is not None:
      selected.setSelected(True)
      self.listWidget.setCurrentItem(selected)


  def populateTable(self, selectedShip=None):
    selected = None
    self.tableWidget.clear()
    self.tableWidget.setSortingEnabled(False)
    self.tableWidget.setRowCount(len(self.ships))
    headers = ["Name", "Owner", "Country", "Description", "TEU"]
    self.tableWidget.setColumnCount(len(headers))
    self.tableWidget.setHorizontalHeaderLabels(headers)
    for row, ship in enumerate(self.ships):
      item = QTableWidgetItem(ship.name)
      item.setData(Qt.UserRole, id(ship))
      if selectedShip is not None and selectedShip == id(ship):
        selected = item
      self.tableWidget.setItem(row, ships.NAME, item)
      self.tableWidget.setItem(row, ships.OWNER,
          QTableWidgetItem(ship.owner))
      self.tableWidget.setItem(row, ships.COUNTRY,
          QTableWidgetItem(ship.country))
      self.tableWidget.setItem(row, ships.DESCRIPTION,
          QTableWidgetItem(ship.description))
      item = QTableWidgetItem("{0:>8}".format(ship.teu))
      item.setTextAlignment(Qt.AlignRight|Qt.AlignVCenter)
      self.tableWidget.setItem(row, ships.TEU, item)
    self.tableWidget.setSortingEnabled(True)
    self.tableWidget.resizeColumnsToContents()
    if selected is not None:
      selected.setSelected(True)
      self.tableWidget.setCurrentItem(selected)


  def populateTree(self, selectedShip=None):
    selected = None
    self.treeWidget.clear()
    self.treeWidget.setColumnCount(2)
    self.treeWidget.setHeaderLabels(["Country/Owner/Name", "TEU"])
    self.treeWidget.setItemsExpandable(True)
    parentFromCountry = {}
    parentFromCountryOwner = {}
    for ship in self.ships.inCountryOwnerOrder():
      ancestor = parentFromCountry.get(ship.country)
      if ancestor is None:
        ancestor = QTreeWidgetItem(self.treeWidget, [ship.country])
        parentFromCountry[ship.country] = ancestor
      countryowner = ship.country + "/" + ship.owner
      parent = parentFromCountryOwner.get(countryowner)
      if parent is None:
        parent = QTreeWidgetItem(ancestor, [ship.owner])
        parentFromCountryOwner[countryowner] = parent
      item = QTreeWidgetItem(parent, [ship.name,"{0}".format(ship.teu)])
      item.setTextAlignment(1, Qt.AlignRight|Qt.AlignVCenter)
      if selectedShip is not None and selectedShip == id(ship):
        selected = item
      self.treeWidget.expandItem(parent)
      self.treeWidget.expandItem(ancestor)
    self.treeWidget.resizeColumnToContents(0)
    self.treeWidget.resizeColumnToContents(1)
    if selected is not None:
      selected.setSelected(True)
      self.treeWidget.setCurrentItem(selected)
    print(parentFromCountry)
    print(parentFromCountryOwner)


  def addShip(self):
    ship = ships.Ship(" Unknown", " Unknown", " Unknown")
    self.ships.addShip(ship)
    self.populateList()
    self.populateTree()
    self.populateTable(id(ship))
    self.tableWidget.setFocus()
    self.tableWidget.editItem(self.tableWidget.currentItem())


  def tableItemChanged(self, item):
    ship = self.currentTableShip()
    if ship is None:
      return
    column = self.tableWidget.currentColumn()
    if column == ships.NAME:
      ship.name = item.text().strip()
    elif column == ships.OWNER:
      ship.owner = item.text().strip()
    elif column == ships.COUNTRY:
      ship.country = item.text().strip()
    elif column == ships.DESCRIPTION:
      ship.description = item.text().strip()
    elif column == ships.TEU:
      ship.teu = item.text()
    self.ships.dirty = True
    self.populateList()
    self.populateTree()


  def currentTableShip(self):
    item = self.tableWidget.item(self.tableWidget.currentRow(), 0)
    if item is None:
      return None
    return self.ships.ship(
        item.data(Qt.UserRole))


  def removeShip(self):
    ship = self.currentTableShip()
    if ship is None:
      return
    if (QMessageBox.question(self, "Ships - Remove",
        "Remove {0} of {1}/{2}?".format(ship.name,ship.owner,ship.country),
        QMessageBox.Yes|QMessageBox.No) ==
        QMessageBox.No):
      return
    self.ships.removeShip(ship)
    self.populateList()
    self.populateTree()
    self.populateTable()


app = QApplication(sys.argv)
form = MainForm()
form.show()
app.exec_()

运行结果:

python3+PyQt5 使用三种不同的简便项窗口部件显示数据的方法

以上这篇python3+PyQt5 使用三种不同的简便项窗口部件显示数据的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。

Python 相关文章推荐
在Python中用split()方法分割字符串的使用介绍
May 20 Python
Django卸载之后重新安装的方法
Mar 15 Python
python itchat实现微信好友头像拼接图的示例代码
Aug 14 Python
Python学习之用pygal画世界地图实例
Dec 07 Python
Python UnboundLocalError和NameError错误根源案例解析
Oct 31 Python
Python数据可视化实现正态分布(高斯分布)
Aug 21 Python
手把手教你Python yLab的绘制折线图的画法
Oct 23 Python
python matplotlib imshow热图坐标替换/映射实例
Mar 14 Python
Python之字符串的遍历的4种方式
Dec 08 Python
如何利用Python matplotlib绘制雷达图
Dec 21 Python
Python Pandas模块实现数据的统计分析的方法
Jun 24 Python
python神经网络学习 使用Keras进行回归运算
May 04 Python
对PyQt5中树结构的实现方法详解
Jun 17 #Python
PyQT实现菜单中的复制,全选和清空的功能的方法
Jun 17 #Python
使用python接入微信聊天机器人
Mar 31 #Python
基于树莓派的语音对话机器人
Jun 17 #Python
PyQt5 QListWidget选择多项并返回的实例
Jun 17 #Python
Pyqt清空某一个QTreeewidgetItem下的所有分支方法
Jun 17 #Python
使用python进行波形及频谱绘制的方法
Jun 17 #Python
You might like
PHP mail 通过Windows的SMTP发送邮件失败的解决方案
2009/05/27 PHP
PHP闭包函数传参及使用外部变量的方法
2016/03/15 PHP
thinkPHP商城公告功能开发问题分析
2016/12/01 PHP
禁止F5等快捷键的JS代码
2007/03/06 Javascript
常用简易JavaScript函数
2009/04/09 Javascript
仿淘宝TAB切换搜索框搜索切换的相关内容
2014/09/21 Javascript
使用JavaScript解决网页图片拉伸问题(推荐)
2016/11/25 Javascript
利用Js的console对象,在控制台打印调式信息测试Js的实现
2016/11/26 Javascript
jQuery插件zTree实现获取当前选中节点在同级节点中序号的方法
2017/03/08 Javascript
深入理解Angular4中的依赖注入
2017/06/07 Javascript
javascript 作用于作用域链的详解
2017/09/27 Javascript
使用json-server简单完成CRUD模拟后台数据的方法
2018/07/12 Javascript
angularJs中$scope数据序列化的实例
2018/09/30 Javascript
关于Layui Table隐藏列问题
2019/09/16 Javascript
vue使用swiper实现中间大两边小的轮播图效果
2019/11/24 Javascript
详解element上传组件before-remove钩子问题解决
2020/04/08 Javascript
javascript设计模式 ? 模板方法模式原理与用法实例分析
2020/04/23 Javascript
Python读大数据txt
2016/03/28 Python
Python分析学校四六级过关情况
2017/11/22 Python
Python学习笔记之函数的定义和作用域实例详解
2019/08/13 Python
基于python及pytorch中乘法的使用详解
2019/12/27 Python
django配置app中的静态文件步骤
2020/03/27 Python
浅谈Python中re.match()和re.search()的使用及区别
2020/04/14 Python
keras导入weights方式
2020/06/12 Python
python中编写函数并调用的知识点总结
2021/01/13 Python
美国精品家居用品网站:US-Mattress
2016/08/24 全球购物
预备党员思想汇报范文
2013/12/29 职场文书
交通安全教育制度
2014/02/02 职场文书
五年级科学教学反思
2014/02/05 职场文书
2014庆六一活动方案
2014/03/02 职场文书
幼儿园大班区域活动总结
2014/07/09 职场文书
小学生运动会报道稿
2014/09/12 职场文书
2015安全保卫工作总结
2015/04/25 职场文书
python实现简单的名片管理系统
2021/04/26 Python
日本官方排名前10的动漫,名侦探柯南上榜,第一是一部创造历史的动漫
2022/03/18 日漫
使用Redis做预定库存缓存功能
2022/04/02 Redis