As Alex said, you can create a dll, export the function you want to access with python with, and use ctypes ( http://docs.python.org/library/ctypes.html ) to access, for example
>>> libc = cdll.LoadLibrary("libc.so.6") >>> printf = libc.printf >>> printf("Hello, %s\n", "World!") Hello, World
or there is an alternative simpler approach that many people do not consider, but are equally useful in many cases, that is, they directly call the program from the command line. You said that you already have a working program, so I assume that it encrypts and decrypts from the command line? if so, why don't you just call the program from the os.system or subprocess module instead of delving into the code and modifying it and maintaining it.
I would say to go the second way if he cannot fulfill your requirements.
source share