improved generation of random data; script for doing all query_python in one go