Using pybricks-micropython
Running this command to get a random port number, works under CPython.
import random
port = random.randint(50000,50999)
produces a number, only it is hardly random it is the same number each time I run the script. I am guessing MicroPython needs something more perhaps?
What am I missing?
John,
I looked up seed with random and used epoch time. Solved.
Ok almost certainly produces a random you could predict, but hey this isn't for the lottery or anything, its for a port number :)
Thanks you, you seeded that answer, forgive the pun.