Skip to main content

Collection of handy random generators.

Project description

xu

Collection of handy random generators.

classes objects functions
integer boolean pick
number char
string random

Examples

from xu import string


print(string(10).lower)
print(string(10).upper)
print(string(10).digit)
print(string(10).alpha)
print(string(10).latin)
print(string(10).list(2))
eoqsalszaj
FCVYJZIDMY
6712277415
oTrbOHkUbd
NcrW4STecT
['euZY9gFrzx', '0AEepSNvAO']

from xu import boolean

for it in boolean.matrix(2, 4):
	print(it)
[False, True]
[True, False]
[True, True]
[False, False]

from xu import pick

data = [1, 2, 3, 4]
print(pick(data))

data = '1234'
print(pick(data, 2))
3
['2', '3']

from xu import integer

print(integer(9) * 5)
print()
for row in integer(9) ** 5:
	print(row)
print()
for row in integer(9) ** (5, 3):
	print(row)
[4, 9, 1, 3, 5]

[4, 2, 0, 8, 8]
[0, 3, 9, 4, 2]
[5, 1, 1, 8, 2]
[1, 5, 3, 5, 6]
[6, 1, 1, 0, 2]

[1, 1, 6, 1, 8]
[4, 0, 2, 3, 9]
[1, 5, 7, 2, 4]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xu-0.2.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

xu-0.2.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page