
本文共 3777 字,大约阅读时间需要 12 分钟。
Python MySQL ������������������ ��������������
1. Python ��� makeup
���������������Python ��������������������������������������������������������������������������������������������������������������� C/C++��� Java���������������������������������������������������������������������
2. MySQL ���������������
��������� Python ������ MySQLDatagram������ gesamt Leder cheaper������������������������������������������������������������������������������������������ SQL ������������������������������ format ��� ���,eg format()
-login supplies��������������������������� SQL ���������������
���������������������.rize������������������������������������������
if������������������zh-reported': create_date = '\''+create_dateif create_date��������� and ���������' zhshi"��� create_date = create_date + "\'"
���������format ������������ SQL ���������
3. ���������������������������
������iazera������������������������ timeout ���birzy�� errors ��������� Kobold've��������� ponder ���������������������������
������������������������
- ���������������
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
- ���������������
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
���������������pip���������������������������������������������������������rite��� ��������������m��thodes���
4. ������pip������������
������ "Cannot uninstall 'filelock'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall."
��������������������������������������������������������������������� ��������������������� akan������ --ignore-installed
���������
������������������ Distutils ������������������������������������
��������������������������� ������������� ��������������������������������������������������������������������� sposob mechanism���������������������������������������������������������������
5. ������������pip
������������ pip ��������������������������������� pip������������
pip install --upgrade pip
���������������pip���������������������umbed���������������������������������������������������
6. ������������
������������������������������������������������ Python ������������������������������������������������������������������������ embed
Directly ������������������������������������������������������������line���������
7. ���������
���������������������������������������������������������������������cakes'clock��������������������������������������Division������������������
8. ������������������
��� class��������������������������� namedtuples ������������������������ classelements���
��������������������� Card(namedtuple)���
from collections import namedtupleCard = namedtuple('Card', ['rank', 'suit'])
���������������������������Votre_class FrenchDockard���
class FrenchDeck: ranks = [str(n) for n in range(2, 11)] + ['JQKA'] suits = 'spades diamonds clubs hearts'.split() def __init__(self): self._cards = [Card(rank, suit) for suit in self.suits for rank in self.ranks] def __len__(self): return len(self._cards) def __getitem__(self, position): return self._cards[position]suit_values = {'spades': 3, 'hearts': 2, 'diamonds': 1, 'clubs': 0}def spades_high(card): rank_value = FrenchDeck.ranks.index(card.rank) return rank_value * len(suit_values) + suit_values[card.suit]deck = FrenchDeck()for card in sorted(deck, key=spades_high): print(card)
���������������������������������������������������������������
������������Cl��s
������������������������������������������������������������������������������������������ ������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
