对 字符串/列表/元组/数列 等数据按固定单元长度分组
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.6.30.tar.gz
(14.3 kB
view details)
Built Distribution
File details
Details for the file skybox-2024.6.30.tar.gz
.
File metadata
- Download URL: skybox-2024.6.30.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33225a0ae360aea619f84ba56d65c28022fff9b8f487d4cadd60702d51db494f |
|
MD5 | 6befc462dc25e52d18a4f4639f64be5d |
|
BLAKE2b-256 | b052c1a7cd7ca810aee6c02fc84a0e6a181cfe03fed2a1e9dd4933d775ef9bbe |
File details
Details for the file skybox-2024.6.30-py2.py3-none-any.whl
.
File metadata
- Download URL: skybox-2024.6.30-py2.py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4dc1d751a07f8d91927f3b8e6d12d3b58670ee75a71c62ece8a9dfdb1febca |
|
MD5 | ffd9d6def728a01fcf5b62720fc4298a |
|
BLAKE2b-256 | 80be1d586926d7e2aee2d67e22e7d936bfd40fa4c0ac79786cc625d48f3eda06 |