What is the best interpereter/IDE for python basic programming?

In summary, Python comes with an IDE, called Idle, and there are other more sophisticated choices, such as Jupyter and PyCharm. However, starting out is easy with PyCharm which is free.
  • #1
shivajikobardan
674
54
TL;DR Summary
I want to write basic python code.
What is the best IDE out there? It should be easy to use. Not as easy as online editors though.
 
Technology news on Phys.org
  • #2
There is no such thing as one "best" editor. It is like asking what is the best car. The answer is mostly subjective. Try what comes with Python to start with.

Python comes with an IDE, called Idle. Jupyter is another more sophisticated choice. Since you asked this question, I am assuming you have limited software development exposure. Getting some complex development package set can turn you off to programming due to the learning curve. Start simple. Fair warning.

Plus you are going to get flooded with suggestions. This kind of question is 'post bait'.
 
  • Like
Likes sysprog, phinds and pbuk
  • #3
jim mcnamara said:
There is no such thing as one "best" editor. It is like asking what is the best car. The answer is mostly subjective.
This is completely true...

jim mcnamara said:
Try what comes with Python to start with.
However I don't agree with this as don't think IDLE is easy to use.

How do you intend to learn Python? If you are following a course then this will focus on a particular IDE.

If you haven't found a course yet then my personal suggestion for the easiest way to get started on any Windows/Mac/Linux system is PyCharm: the company that supplies it also does a free course.
 
  • Like
Likes sysprog
  • #4
I am a total beginner in python and programming overall. I have no idea which interpreter to use. So I am asking so that people in community can guide me a bit. I want sth easy but not as easy as online compilers/interpreters.
 
  • #5
pbuk said:
This is completely true...However I don't agree with this as don't think IDLE is easy to use.

How do you intend to learn Python? If you are following a course then this will focus on a particular IDE.

If you haven't found a course yet then my personal suggestion for the easiest way to get started on any Windows/Mac/Linux system is PyCharm: the company that supplies it also does a free course.
I am learning from course, the problem is that that course uses online compiler OR sth that it doesn't talk about. that's the whole issue tbh
 
  • #6
shivajikobardan said:
have no idea which interpreter to use.
Python is an interpreter; that's what the Python executable does. You can run Python interactively and enter Python code and have it executed. In fact that is often a useful thing to do to help you understand how Python works.

As for editors, any basic text editor that has syntax highlighting will do to start with. Python is unlike compiled languages like C++ in that it does not require a lot of supporting infrastructure like compilers and linkers to build your program, so there are fewer advantages to an IDE with Python because much of what an IDE does in languages like C++ is to organize the build process. In Python your program is just the Python source file.
 
  • Skeptical
Likes pbuk
  • #8
Many programmers use VS Code Editor with python extensions. VS Code is very responsive and supports many languages. Programmers really like it a lot.

https://code.visualstudio.com/

And the there's PyCharm by JetBrains which is an excellent Python IDE. It has great debugging tools as well as syntax checkers.

https://www.jetbrains.com/pycharm/

Lastly, there the Jupyter Notebook IDE which is very easy to use and very powerful. Some profs use it to teach Julia, Python and R programming.

https://jupyter.org/

Whats nice about the Jupyter IDE is that you can experiment with python code chunks interactively and the output is placed in the same page below the code. You can also use markdown to add comments to the notebook page and save it for a later session.

You can also find some comparative reviews of these IDEs online such as:

https://arbisoft.com/blog/vs-code-versus-pycharm-the-smackdown/

https://towardsdatascience.com/jupyter-notebook-vs-pycharm-7301743a378
 
  • Like
Likes sysprog
  • #9
PeterDonis said:
As for editors, any basic text editor that has syntax highlighting will do to start with.
I have three problems with your suggestion:
  • A basic text editor will not help you install Python and if you are using Windows this is not trivial: each of @jedishrfu's suggestions (in VS Code's case with the Microsoft Python plugin) does this for you.
  • A basic text editor may do to start with, but you will need to leave it for something more advanced at some stage. You also need to learn how to use the text editor as well as learning Python and the fundamentals of programming. Again with each of @jedishrfu's suggestions you have a tool that will take you from beginner to advanced (although Jupyter is more specialised than the other two and cannot really be used for, for instance, writing a game).
  • It is easier to learn when you have an IDE prompting you; I know this is something @PeterDonis where you and I do not agree but I will post an example later to illustrate just what I mean (note however that Jupyter does NOT offer this facility in the same way as VS Code or PyCharm do and I would only recommend it if you are following a course specifically using Jupyter).
 
  • Like
Likes jedishrfu
  • #10
pbuk said:
It is easier to learn when you have an IDE prompting you ... I will post an example later

I regularly write, review and test code in a number of different languages (Node.js/JavaScript, Typescript, Python PHP, C++...). I do all of this in Microsoft's free program Visual Studio Code because (i) it means I don't have the distraction of switching between different IDEs with different command sets and (ii) because of its astonishing rate of adoption among the developer community over the last 5 years it has plugins for every purpose a developer could want.

So how does this work in practice? Well let's take a simple example: I want to read the contents of a directory in Python. I know the function is in the os module, and I think it's os.readdir so I start typing...

1 python not read.png


No, obviously not, must be list... er, something, so I type 'li' and...

2 python is listdir.png


Oh yes, listdir, that's it. Now does this need an open directory handle or can I just pass it a string? Hit tab to select listdir and open a bracket and...

3 python intellisense.png


OK, a string is fine (it says this is 1 of 4 overloads so I guess I could use a directory handle as well) - and it also tells me it returns a list of strings which must be filenames. Great, let's print it out...

4 python linting.png


I am a terrible typist, but the squiggly yellow line tells me that I am using a variable name that has not been declared so I know I need to correct it, so I do and then I run it. But guess what, I decide I'd rather do this in Node.JS so I start a new file. Now I know I need the fs module, do you think it could be listdir again?

5 node js not list.png


Nope...

6 node readDir(Sync).png


... ah yes, because Node is asynchronous by default (if you don't know what that means yet, don't worry) there are two alternatives: readdir and readdirSync. For this simple task I'll use the synchronous version but I could do with a reminder of how that works so again type readdirSync( and...

7 node intellisense.png


Great, I'm not sure what it means by a PathLike but I'll try a string '.'.

Oops, forgot to do a screen grab - but I think I've probably shown enough: if you are not convinced enough to give VS Code a try now (or if you only code in Python you will see similar functionality in PyCharm or, to a slightly lesser extent Spyder) you will never be.
 
  • Like
  • Love
Likes sysprog, jedishrfu and Mark44
  • #11
pbuk said:
I have three problems with your suggestion:
  • A basic text editor will not help you install Python and if you are using Windows this is not trivial:
Sure it is:

https://www.python.org/downloads/windows/

pbuk said:
  • A basic text editor may do to start with, but you will need to leave it for something more advanced at some stage.
I have been programming using basic text editors for more than three decades now, so I don't think your general claim here is true. Some programmers prefer using an IDE, some don't.

pbuk said:
  • You also need to learn how to use the text editor
A basic text editor is pretty much the simplest program out there; certainly it's simpler than any IDE.

pbuk said:
  • as well as learning Python and the fundamentals of programming.
Yes, of course; you're going to have to do that no matter what tools you use to write your code.

pbuk said:
  • Again with each of @jedishrfu's suggestions you have a tool that will take you from beginner to advanced
It will take you from beginner to advanced beginner, perhaps. No tool by itself can take you to advanced. That only comes with experience.

pbuk said:
  • It is easier to learn when you have an IDE prompting you
It is for some people, perhaps. It isn't for everybody. I have tried various IDEs over the years and all they did was get in my way.
 
  • #12
pbuk said:
A basic text editor will not help you install Python and if you are using Windows this is not trivial:
PeterDonis said:
Sure it is
I should note, btw, that the Python development team over the years has always shipped Windows installers for each new version of Python that comes out. AFAIK more Python core developers work on Windows than on either of the other two major desktop OSs (Mac and Linux). I do most of my development work on Linux but I routinely use a Python install like the ones I linked to on a Windows machine to test things on Windows.
 
  • #13
pbuk said:
However I don't agree with this as don't think IDLE is easy to use.
In my experience, most of the program usage consists of two steps: (1) write code, (2) press F5 to run code.
 
  • #14
PeterDonis said:
Sure it is:
Hmmm, here are the trivial steps I have just taken to get to "Hello World" on a clean Windows 11 install:
  1. Download the installer from python.org and run it.
  2. Click the checkbox highlighted in the screen grab below - this is not checked by default and there is nothing to tell you that if you don't do this nothing will work.
    Screenshot 2021-11-24 115647.png
  3. Select 'Install Now' rather than 'Customize installation' because we are going for the trivial route (and note that Python is going to be installed in C:\Users\pbuk\AppData\Local\Programs\Python\Python310 if I need that later, to set up as a Notepad++ 'run' option for instance).
  4. Download and install a text editor (I used to use Notepad++ so I'll go with that).
  5. Open a folder to work in and create a new text file 'hello.py'.
  6. Realise that the file I have created is actually called 'hello.py.txt'.
  7. Select View->Show->File name extensions so File Explorer stops getting in the way. Select Show Hidden Items as well otherwise that will probably throw me later.
  8. Rename 'hello.py.txt' to 'hello.py'.
  9. Right click on 'hello.py' and choose Open With -> Choose another app -> More apps -> Notepad++ and click 'Always use this app to open .py files'.
  10. Open 'hello.py', create my 'print("Hello World!")' program and save it.
  11. Open a terminal window to run the program: if you have done this before you get "Open in Windows Terminal" as an option on the right-click menu in File Explorer, otherwise you have to hit Start and select Windows Terminal (which defaults to PowerShell, although you can select PowerShell directly, or Command Prompt if you insist).
  12. Powershell will launch in your home directory; you could navigate to the folder you put hello.py in from there with cd if you know how, otherwise probably best to close this instance of PowerShell and open a new one using the right click option that should now be in File Manager.
  13. Enter 'python hello.py' to run your program... nothing happens.
  14. Realise that you need to reboot for the path settings to take effect, so restart (log off might be enough but to be sure...) - it would have been helpful for the installer to tell me to do this but hey-ho.
  15. After restarting, open up the folder, right click -> Open in Windows Terminal, enter 'python hello.py' and say hello to the brave new world.
 
  • Wow
Likes sysprog
  • #15
pbuk said:
Click the checkbox highlighted in the screen grab below - this is not checked by default and there is nothing to tell you that if you don't do this nothing will work.
I agree it would be nice if that were checked by default, since on Windows every new program you install gets its own directory and you need to add that to the PATH to have things work from the command line.

pbuk said:
  1. Realise that the file I have created is actually called 'hello.py.txt'.
  2. Select View->Show->File name extensions so File Explorer stops getting in the way. Select Show Hidden Items as well otherwise that will probably throw me later.
These are things you have to do on Windows anyway to get around the braindead defaults of File Explorer.

pbuk said:
Realise that you need to reboot for the path settings to take effect, so restart (log off might be enough but to be sure...)
This also is something you have to do any time you install anything on Windows that needs to be added to the PATH (or indeed any time you install pretty much anything on Windows).

To me these are all reasons not to learn how to program on Windows. On Linux none of this is even an issue; Python comes pre-installed with pretty much any distro, it's already on your path (since executables go in a pre-defined place and you don't need to add a new directory to your path every time you install something), Linux, like any Unix, has a real command line that isn't bolted on as an afterthought, and basic text editors are two a penny and will also already be installed on your system.

Different workflows work for different people. The OP has plenty of suggestions now to choose from.
 
  • Like
Likes sysprog
  • #16
PeterDonis said:
To me these are all reasons not to learn how to program on Windows.
At last something we can agree on!
 
  • Like
Likes sysprog
  • #18
  • Haha
Likes jedishrfu
  • #19
VS Code! VS Code!

Get it now! Get it now!

And you'll be so happy! And you'll be so happy!

Ding Ding Dong! Ding Ding Dong!

(sing to Frere Jacques)
 

1. What is the best interpreter for python basic programming?

The best interpreter for python basic programming is a matter of personal preference and can vary depending on the specific needs and goals of the user. Some popular options include IDLE, PyCharm, and Jupyter Notebook.

2. Is an IDE necessary for python basic programming?

No, an IDE (Integrated Development Environment) is not necessary for python basic programming. An IDE can provide additional features and tools to enhance the coding experience, but many programmers prefer to use a simple text editor and the command line.

3. Which interpreter/IDE is best for beginners?

For beginners, IDLE is a great choice as it comes bundled with the standard python installation and has a user-friendly interface. PyCharm also has a beginner-friendly interface and offers helpful features such as code completion and debugging.

4. What is the difference between an interpreter and an IDE?

An interpreter is a program that executes code line by line, while an IDE is a software application that provides a comprehensive set of tools for coding, debugging, and managing projects. The main difference is that an IDE is a complete development environment, while an interpreter is just a component of the development process.

5. Are there any free options for python basic programming interpreters/IDEs?

Yes, there are many free options for python basic programming interpreters and IDEs. Some popular ones include IDLE, PyCharm Community Edition, and Visual Studio Code. These free options can provide a great coding experience without the cost of a paid IDE.

Similar threads

  • Programming and Computer Science
2
Replies
56
Views
8K
  • Programming and Computer Science
Replies
3
Views
586
Replies
6
Views
643
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
463
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
13
Views
2K
  • Programming and Computer Science
Replies
1
Views
726
  • Programming and Computer Science
Replies
5
Views
845
  • Programming and Computer Science
Replies
3
Views
1K
Back
Top