I want to execute some other programming languages (e.g. C++ / java / kotlin) inside python and get the output.
is there any library or solution for this?
I dont want to create new programming language . I just want to compile codes.
>Solution :
you can use run, PIPE function from subprocess library and system function from os library like this:
from os import system as sys
from subprocess import run, PIPE
# Example for c language with gcc compiler
sys('gcc ./something.c -o out')
out = run(["./out"], stdout=PIPE).stdout.decode("UTF-8")
print(out)
you can use run and system function in macos and linux, i think you can use it in windows too but i’m not sure