对 字符串/列表/元组/数列 等数据按固定单元长度分组
Project description
一个用来对 字符串/列表/元组/数列 等数据按固定单元长度分组的功能:
from skybox import sky_box
# 分字符串
data = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
sky_box(data, 3) # >>> ['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQR', 'STU', 'VWX', 'YZ']
# 分列表
data = ['赤', '橙', '黄', '绿', '青', '蓝', '紫']
sky_box(data, 3) # >>> [['赤', '橙', '黄'], ['绿', '青', '蓝'], ['紫']]
# 分元组
data = ('赤', '橙', '黄', '绿', '青', '蓝', '紫')
sky_box(data, 3) # >>> [('赤', '橙', '黄'), ('绿', '青', '蓝'), ('紫',)]
# 分数列
data = range(1, 15)
sky_box(data, 3) # >>> [range(1, 4), range(4, 7), range(7, 10), range(10, 13), range(13, 15)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
skybox-2024.3.6.tar.gz
(6.6 kB
view details)
Built Distribution
File details
Details for the file skybox-2024.3.6.tar.gz
.
File metadata
- Download URL: skybox-2024.3.6.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06c9665ba4c7c9cf9e83c38634bb9d4ffa49f0a46e105a422b37b3435aaa4604 |
|
MD5 | 72b8db0912d25fca6063585d0ec77680 |
|
BLAKE2b-256 | ea53484ec04feb248fc71d82622e4390a2377bc6fe75a812a2b2ae2abd981edb |
File details
Details for the file skybox-2024.3.6-py2.py3-none-any.whl
.
File metadata
- Download URL: skybox-2024.3.6-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cf4771d924bc014c571d6e62570364d5c9ee4880dd6bb9b29bfda780a82181c |
|
MD5 | f2a1c2098cb6e34792cbe13acdd00288 |
|
BLAKE2b-256 | 5ff849e8c0e0e9993cd7f0b12c87c0154c15cbb42cee9d01a8fa25f1f0e02486 |