py_everything.rand

Source code: py_everything/rand.py

This module Random generators for many things such as a random hex code generator, random RGB color generator, random float generator, and much more!

py_everything.htmlXml.randhex()

Generates a random hex color code such as #2A34FD

Returns string

The hex color code as a string

py_everything.htmlXml.randRGB()

Generates a random RGB color and returns that as a tuple in the format - (red, green, blue)

Returns tuple

The RGB color as a tuple

py_everything.htmlXml.randletter()

Generates a random alphabet and returns that as a string.

Returns string

The random alphabet

py_everything.htmlXml.randint(start, end)

Generates a random integer from among a given range and returns that

Parameters
  • start (int) – Start value of range

  • end (int) – End value of range

Returns int

The random integer

py_everything.htmlXml.randfloat(start, end)

Generates a random float between given range

Parameters
  • start (float) – Start value of range

  • end (float) – End value of range

Returns float

The random float

py_everything.htmlXml.randbool()

Generates a random boolean, either True or False

Returns bool

The random boolean

py_everything.htmlXml.randboolList(len)

Generates a list of random boolean values

Parameters

len (int) – Length of list

Returns list

The list of randomly generated boolean values

py_everything.htmlXml.randstring(string)

Returns a random letter from a given string.

Parameters

string (str) – The string to choose random letter from

Returns str

The random letter chosen from the string