对 字符串/列表/元组/数列 等数据按固定单元长度分组
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.8.25.tar.gz
(16.9 kB
view details)
Built Distribution
File details
Details for the file skybox-2024.8.25.tar.gz
.
File metadata
- Download URL: skybox-2024.8.25.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a5c7bfb67460039ac6bc6238e87be70462b57e78d5ddc105efd15122819441e |
|
MD5 | 81e22195b8f7ae4f344fbe9ab6ecc76c |
|
BLAKE2b-256 | 2ddc273ac5374dd381416a3ac75dff6e6dc55d34959aea6f08456a04c833def6 |
File details
Details for the file skybox-2024.8.25-py2.py3-none-any.whl
.
File metadata
- Download URL: skybox-2024.8.25-py2.py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66f90aec6f404ce6565bea6615f58633d0fc83e0b54ea73e6980c406d54d985 |
|
MD5 | a0374eb08ad4df77ba8db040b19e9420 |
|
BLAKE2b-256 | 2b02dac5e2436f6e8da6366296cbee243b05eb3e9f571c731248c007c86f9492 |