I would like to encrypt a secret text by public-key and decrypt it by private-key in Python. I can achieve that with the openssl command:
openssl
The m2crypto module(s) expose much of OpenSSL's functionality to Python, including public/private encryption, decryption, and signing.
Most Linux distribution provide the m2crypto module as a native package.