r/learnpython • • Jan 05 '24

Why are interpreters required for programming ?

i'm trying to learn python ....i'm hearing a lot of stuff about interpreters....just wanna know what are they for..why are they required...can i learn python without interpreter...without vs code or py charm

Cuz i wrote some codes in python and it worked without connecting python to interpreter ....why is an interpreter necessary

Plz enlighten me

14 Upvotes

71 comments sorted by

View all comments

5

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Jan 05 '24

....i'm hearing a lot of stuff about interpreters....just wanna know what are they for..why are they required...

Taking your question at face value, in its simplest form an interpreter is a program that takes a program written in a programming language it understands, parses it, and executes the program. To put it another way, if the language lacks a compiler you need an interpreter to run programs written in that language.

can i learn python without interpreter...

Technically speaking, yes, but not having a way to actually run the code you write would make it an arduous journey, hardly worth the effort, and even if in theory you came to understand the language in full you'd still lack practical experience in using the language and would likely be stumped by errors related to the filesystem or third-party packages, for example.

without vs code or py charm

The others already touched on this, but those are integrated development environments, not interpreters. They'll give you access to an interpreter you've installed on your system, and you can develop programs without fancy editors if you really wanted to, but in the professional world the only metric that matters is getting work done. And both PyCharm and VS Code would absolutely help with that. There's a reason most people use them (or equivalents).

Cuz i wrote some codes in python and it worked without connecting python to interpreter ....why is an interpreter necessary

Again, it just sounds like you are confusing interpreters and code editors.