MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / record

Function record

code/IO/postgres_crud.py:35–41  ·  view source on GitHub ↗

Return a random integer, float, and pet type.

()

Source from the content-addressed store, hash-verified

33import time
34
35def record():
36 """Return a random integer, float, and pet type."""
37 n = random.randint(1,15)
38 price = 10.0 + 30*random.random()
39 pet = random.choice(['dog', 'cat',
40 'bunny', 'fish', 'horse'])
41 return (n, price, pet)
42
43def populate_table(conn, cur):
44 T_start = time.time()

Callers 1

populate_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected