Share your repls and programming experiences

← Back to all posts
Working Terminal like thing!
Viper2211 (56)

I just used the exec function and the eval function to create what seems like a real python terminal!

Highwayman (1318)

What’s the difference between exec and eval? I’ve never seen exec before I think.


@Highwayman the exec() function executes a string or code object as python code. eval() essentially does the same thing, but runs the code within the program.

More Information:

nt998302 (160)

I did this too at one point in time! It's fun making these. Maybe make your own OS?

AmazingMech2418 (661)

@nt998302 You can get a bash command line in this by typing "from os import system" and "system('sh')". You can also convert the Python command line into bash by using "from os import system as exec". If in the bash command line, you can also run the actual python shell by typing "python".

nt998302 (160)

@AmazingMech2418 Sweet. Don't know much about system, but I know about exec. I usually just develop games xD

LizFoster (592)

Wow! Nice work! This is pretty cool. ^ ^*