Python: Choosing a Text Editor or IDE

  1. Introduction to Python
  2. Python: Choosing a Text Editor or IDE
  3. Python: Hello World
  4. Python: Variables, Strings and Numbers
  5. Python: Variable Naming
  6. Python: Math, Familiar
  7. Python: Math, Less Familiar
  8. Python: Mathematical Order of Operations
  9. Python: Introducing PEP 8
  10. Python: Text Concatenation
  11. Python: if Statements and Comparison Operators
  12. Python: else and elif statements
  13. Python: Testing Multiple Conditions
  14. Python: Testing Sets of Conditions
  15. Python: Nested if Statements
  16. Python: Lists
  17. Python: Adding To and Changing Lists
  18. Python: Lists: Take a Slice, Delete Elements, Popping Elements
  19. Python: Tuples
  20. Python: for Loops
  21. Python: Nested for Loops
  22. Python: Capturing and Formatting User Input
  23. Python: Dictionaries
  24. Python: Functions
  25. Python: While Loops
  26. Python: Creating and Using Classes
  27. Python: Data Files
  28. Python: Modules
  29. Python: CSV Files
  30. Python: JSON Files
  31. Python: Errors and Exception Handling
  32. Python: Using Pexpect
  33. Python : Using Pexpect : ftpTestOffload.sh
  34. Python : Using Pexpect: ftpTest.py
  35. Python: DCL Conversion to Python

Which Text Editor Should You Choose?

This is the kind of question that’ll get you into a war on Reddit. Do some quiet research before asking online.

If you’re comfortable using vi or vim, they’re perfectly fine. Beginners don’t usually start with vi these days, but you may run into environments where it’s your only option.

More advanced programmers are going to need a full IDE to wrangle large projects. Unless you’re already experienced with IDEs, just use a simple text editor for now. For a typical extremely detailed StackOverflow type answer, see this:
https://stackoverflow.com/questions/81584/what-ide-to-use-for-python

If you’re not familiar with StackOverflow yet, remember this site! Etiquette is a big deal here, so be careful of your reputation points.

For a more chatty, friendly Quora discussion, see here:
https://www.quora.com/What-is-the-best-IDE-for-Python

And if you prefer video, this one is great for illustrating the points of difference (and argument). Especially note the comments:
https://www.youtube.com/watch?v=qThV8oLKfWU

But if you really want just a simple IDE that lets you edit and run scripts, IDLE is probably the easiest option. Go here to find the simple commands to install IDLE in Linux:
http://elearning.wsldp.com/pcmagazine/install-python-idle-editor-centos-7/

Now you’re ready to follow this video on using both the python shell and idle commands:
https://www.youtube.com/watch?v=kXbpB5_ywDw

Someday you’ll want something more advanced. If you haven’t already run into it, you’re going to find automatic code completion a magical blessing. In the Microsoft IDE world it’s called IntelliSense, and you’ll get it using MS’s Visual Studio Code IDE, which can be installed on Linux, Mac and Windows. Other environments like Eclipse offer some nice Python-coding features and plugins too, so don’t think MS is the only way to go.

Finally, the most popular tool for Python development, according to recent research, is PyCharm. See https://www.jetbrains.com/research/python-developers-survey-2017/, and https://www.jetbrains.com/pycharm/ to find downloads.

We’re Going to Use the Python Shell and Nano

The python shell is already installed on any Linux system that has Python. (I’m using lowercase “python” to indicate the command, while the proper noun “Python” gets an initial cap). On most other OSs you’ll need to install a Python package.

Assuming Python is installed, all you have to do is open a terminal and type:

python

This puts you at a command line where you can enter Python commands. It’s great for one-liners, but not very useful for building scripts.

Instead, we’ll run Nano from the command line:

nano myscript.py

You’ll find it handy to have two terminal windows open, one for Nano and the other to run your code.