摘要:# This is a sample Python script. from os import listdir import csv import numpy import pandas as pd # C:\\Users\\geovindu\\PycharmProjects\\pythonPro
阅读全文
posted @ 2022-11-21 16:17
®Geovin Du Dream Park™
阅读(47)评论(0)推荐(0)
摘要:GeovinDuState.py #状态模式 State Pattern class ComputerState(object): name = "state" allowed = [] def switch(self, state): """ Switch to new state """ if
阅读全文
posted @ 2022-10-26 23:43
®Geovin Du Dream Park™
阅读(27)评论(0)推荐(0)
摘要:GeovinDuTemplate.py # 模板方法模式 Template Method Pattern def get_text(): return "text 文件" """ method to get the xml version of file""" def get_xml(): retu
阅读全文
posted @ 2022-10-26 22:49
®Geovin Du Dream Park™
阅读(22)评论(0)推荐(0)
摘要:GeovinDuObserver.py # 观察者模式 Observer Pattern # The Observer class that recieves updates from the ticker on a specific symbol: class TickerObserver(obj
阅读全文
posted @ 2022-10-24 22:05
®Geovin Du Dream Park™
阅读(30)评论(0)推荐(0)
摘要:DuChain.py # 责任链模式 Chain of Responsibility import enum # Item Types: # An enum we'll attach to every game object to specify type: # Requires Python 3.
阅读全文
posted @ 2022-10-23 08:22
®Geovin Du Dream Park™
阅读(39)评论(0)推荐(0)
摘要:DuFlyweight.py # 享元模式 Flyweight Pattern geovindu,Geovin Du,涂聚文 import time class Arrow: def __init__(self, x, y, z, velocity): self.x = x self.y = y s
阅读全文
posted @ 2022-10-22 11:32
®Geovin Du Dream Park™
阅读(25)评论(0)推荐(0)
摘要:DuFacade.py import os import re import threading # 外观模式 Facade Pattern class _IgnitionSystem(object): @staticmethod def produce_spark(): return True c
阅读全文
posted @ 2022-10-22 07:07
®Geovin Du Dream Park™
阅读(26)评论(0)推荐(0)
摘要:DuComposite.py # 组合模式 Composite Pattern from __future__ import annotations from abc import ABC, abstractmethod from typing import List class Component
阅读全文
posted @ 2022-10-21 22:21
®Geovin Du Dream Park™
阅读(24)评论(0)推荐(0)