user43089: 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?

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


43089: <p>Pretty same question was asked <a href="https://bitcoin.stackexchange.com/questions/13970/python-code-to-generate-private-ecdsa-key">here</a>, but maybe there is a way to generate keys using <a href="https://github.com/warner/python-ecdsa" rel="nofollow noreferrer">ecdsa</a> module in just a few lines of code?</p>
 2306: <p>Yes:</p>

<pre><code>import ecdsa
print(ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1).to_string())
</code></pre>
