File: utils.py

package info (click to toggle)
sen 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,516 kB
  • sloc: python: 5,456; xml: 21; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 315 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import string
import random

import urwid


characters = string.digits + string.ascii_letters + string.punctuation


def get_random_text(length=32):
    return "".join([random.choice(characters) for _ in range(length)])


def get_random_text_widget(length=32):
    return urwid.Text(get_random_text(length=length))