eagleye

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 45 下一页

2024年9月3日

Python字符串列表去重并保持原顺序不变

摘要: # 字符串列表去重并保持原顺序 def deduplicate_preserve_order(lst): """ :param lst:字符串列表 功能:返回字符串列表去重后的列表。 """ return list(OrderedDict.fromkeys(lst)) 阅读全文

posted @ 2024-09-03 08:13 GoGrid 阅读(44) 评论(0) 推荐(0)

2024年8月15日

Python使用普通函数模拟生成器

摘要: def flatten(nested): result = [] try: # 不迭代类似于字符串的对象 try: nested + '' except TypeError: pass else: raise TypeError for sublist in nested: for element 阅读全文

posted @ 2024-08-15 21:35 GoGrid 阅读(14) 评论(0) 推荐(0)

Python递归式生成器

摘要: def flatten(nested): try: # 不迭代类似于字符串的对象 try: nested + '' except TypeError: pass else: raise TypeError for sublist in nested: for element in flatten(s 阅读全文

posted @ 2024-08-15 17:15 GoGrid 阅读(16) 评论(0) 推荐(0)

2024年8月14日

Python面向对象设计的一些重要概念

摘要: 对象:对象由属性和方法组成。属性不过是属于对象的变量,而方法是存储在属性中的函数。相比于其他函数,(关联的)方法有一个不同之处,那就是它总是将其所属的对象作为第一个参数,而这个参数通常被命名为self。 类:类表示一组(或一类)对象,而每个对象都属于特定的类。类的主要任务是定义其实例将包含的方法。 阅读全文

posted @ 2024-08-14 09:34 GoGrid 阅读(20) 评论(0) 推荐(0)

Python关于面向对象设计的思考

摘要: 1.将相关的东西放在一起。如果一个函数操作一个全局变量,最好将它们作为一个类的属性和方法。 2.不要让对象之间过于亲密。方法应只关心其所属实例的属性,对于其他实例的状态,让它们自己去管理就好了。 3.慎用继承,尤其是多重继承。继承有时很有用,但在有些情况下可能带来不必要的复杂性。要正确地使用多重继承 阅读全文

posted @ 2024-08-14 09:21 GoGrid 阅读(19) 评论(0) 推荐(0)

2024年8月12日

Python开发GUI——PyCharm+PySide6外部工具设置之pyside6-rcc

摘要: 阅读全文

posted @ 2024-08-12 17:52 GoGrid 阅读(86) 评论(0) 推荐(0)

Python开发GUI——PyCharm+PySide6外部工具设置之pyside6-uic

摘要: 阅读全文

posted @ 2024-08-12 17:49 GoGrid 阅读(51) 评论(0) 推荐(0)

Python开发GUI——PyCharm+PySide6外部工具设置之pyside6-designer

摘要: 阅读全文

posted @ 2024-08-12 17:46 GoGrid 阅读(52) 评论(0) 推荐(0)

2024年8月11日

Python使用PyCharm+PySide6+Pandas创建QTableView显示Excel工作簿数据

摘要: import sys import warnings from pathlib import Path import pandas as pd from PySide6 import QtWidgets from PySide6.QtCore import Qt from PySide6.QtGui 阅读全文

posted @ 2024-08-11 18:51 GoGrid 阅读(572) 评论(0) 推荐(0)

Python使用PyCharm+PySide6创建一个简单的Qt Quick应用程序-hello_world_quick.py(读取qml文件方式)

摘要: """Create a Simple Quick Application""" import sys from pathlib import Path from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlAp 阅读全文

posted @ 2024-08-11 09:13 GoGrid 阅读(440) 评论(0) 推荐(0)

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 45 下一页

导航