How to generate Bitcoin private - public keys with ECDSA module? Pretty same question was asked here, but maybe there is a way to generate keys using ecdsa module in just a few lines of code?
Yes:

import ecdsa
print(ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1).to_string())