You have to use elliptic curve multiplication to multiply the private key by the generator point (G) in the secp256k1 curve to obtain the public key. The compressed generator point for bitcoin is as follows:
02 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798
Public key = Private key * G
If you want to read more about how this is done, I would suggest starting here:
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc#public-keysElliptic-curve cryptography (ECC) is not trivial. This is one of the great ironies with Bitcoin, in my opinion, that calculating the public key (which is NOT the same thing as the public address) is by far the toughest part of the sequence.
In my code in the previous post, I used this library (my warmest recommendations!)
https://github.com/AntonKueltz/fastecdsa(I used "sudo python3 -m pip install fastecdsa" to install it, and I'm well aware that this particular method, even though it works like a charm, is often frowned upon.)
And I showed how it can be used to derive what the OP wanted. Exact code (albeit poorly commented); what more do you need?
Edit: The code TheArchaeologist share is pretty neat, but it doesn't include ECC, getting the public key to begin with, also the toughest part.)