2023年10月12日
- 全部
- Cat
- Database
- Git Tutorial 1
- Html/CSS
- JavaScript
- Linux
- Linux
- MySQL/MariaDB
- PostgreSQL
- Programming
- Python
- Python
- RegExp
- Vue3 Guide
- Git
- Html Tutorial
- JavaScript
- MDN References
- MySQL Tutorial
- MySQL/MariaDB
- NAS
- PostgreSQL 14.1 Manual
- Programming
- Python HM
- Vue3 API
- Database
- Database
- JavaScript HM
- PostgreSQL
- PostgreSQL Mod Docs
- Python
- Python Tutorial
- Router
- Vue3 Tutorial 1
- Web API Tutorial
- Windows
- Android
- JavaScript
- JavaScript Tutorial
- OS
- Python Data Tutorial
- Redis
- Vue3 Tutorial 2
- C Tutorial
- Git Tutorial 2
- Html/CSS
- JavaScript ES6 Tutorial
- Practice
- Python 3.12.1 Docs
- Vue3 Tutorial 3
- Django
- PHP
- Software
- Vue
- Vue3 Tutorial 4
- C/C++
- Django3.1 Tutorial
- Hardware
- Network
- RegExp
- English
- RegExp Info
- WordPress
- Linux Command
- Maths/AI
- Resource
- Essays
- Google Style Guide
- General
- Memorandum
- Games
- Recipes
- 未分类
- SEO
- Virtualization
- Office
- ERP
- Django 5.0.2 Docs
2023年10月6日
2023年10月1日
2022年8月15日
a = 'aa'
b = 'bb'
tuple_ = (a, b)
dict_ = {'c': 'cc', 'd': 'dd'}
def test(*args, **kwargs):
print(args)
for item in args:
print(item)
print(kwargs)
for key, value in kwargs.items():
print(key, value)
if __name__ == '__main__':
test('vv', 'ww', x='xx', y='yy', *tuple_, **dict_)
结果:
('vv', 'ww', 'aa', 'bb')
vv
ww
aa
bb
{'x': 'xx', 'y': 'yy', 'c': 'cc', 'd': 'dd'}
x xx
y yy
c cc
d dd
进程已结束,退出代码0…
2022年7月28日
import inspect
class A(object):
a = 10
@classmethod
def get_attribute(cls):
print('1', vars(cls))
print('2', dir(cls))
print('3', cls.__dir__(cls))
print('4', cls.__dict__)
print('5', locals())
print('6', globals())
print('*' * 20)
attr_ = inspect.getmembers(cls, lambda a: not inspect.ismethod(a))
print('1', attr_)
attr_ = filter(lambda a: not a[0].startswith('__'), attr_)
print('2', attr_)
attr_ = lis…
2022年7月17日
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>XX商城-注册</title>
<link rel="stylesheet" type="text/css" href="{{ static('css/rese…
2022年7月2日
2022年6月22日
2022/02/simple_http_server_web_framework.zip
import sys
import threading
import socket
import os.path
import json
import struct
import hashlib
import re
import framework
from content_type import content_type
class NetworkCommunicateRole(object):
def role_choose(self):
while True:
role = input("请选择角色 Http服务(h)/服务端(s)/客户端(c):")
if role == "h":
return "http_server",
elif role == "s":
return "server",
elif…
2022年6月21日
def decorator(cls):
_instance = {}
print(f"instance: {_instance}")
def inner():
if cls not in _instance:
_instance[cls] = cls()
print(f"instance: {_instance}")
return _instance[cls]
return inner
@decorator
class ClassA(object):
def __init__(self):
self.a = 10
obj_1 = ClassA()
obj_2 = ClassA()
print(id(obj_1))
print(id(obj_2))
# ClassA = decorator(ClassA)
# obj_A = ClassA()
# print(obj_A.a)…
2022年6月19日
import pymysql
connector = pymysql.connect(host="localhost", port=3306, user="root", password="", database="python", charset="utf8")
cursor = connector.cursor()
print(cursor.execute("show tables;"))
print(cursor.fetchall())
print(cursor.execute("desc class;"))
print(cursor.fetchall())
print(cursor.execute("select * from class;"))
print(cursor.fetchall())
id_ = input("请输入ID:")
paramete…