Can the cd command in Python be used to change directories like in the terminal?

22 Replies, 1525 Views

Hey y'all,
So I was messing around with Python and had this random thought... can the cd command Python work like it does in the terminal? Like, y'know, just typing `cd` and poof, you're in a new directory?

I tried googling it but got mixed answers. Some say you gotta use `os.chdir()` or something, but idk if that’s the same as the cd command Python vibes.

Anyone tried this before? Or am I just overcomplicating things lol.

Also, if it’s not the same, why not? Feels like it should be, right?

Thanks in advance for any tips! ✌️

Messages In This Thread
Can the cd command in Python be used to change directories like in the terminal? - by - 10-06-2024, 05:10 AM



Users browsing this thread: 1 Guest(s)