Share your repls and programming experiences

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

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

LizFoster (640)

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

AphixDev (211)

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

AphixDev (211)

Oops, meant bash

AmazingMech2418 (1102)

@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".

AphixDev (211)

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

UniqueOstrich18 (340)

or you could just run os.system("python3")

Highwayman (1501)

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: