- Introduction to Python
- Python: Choosing a Text Editor or IDE
- Python: Hello World
- Python: Variables, Strings and Numbers
- Python: Variable Naming
- Python: Math, Familiar
- Python: Math, Less Familiar
- Python: Mathematical Order of Operations
- Python: Introducing PEP 8
- Python: Text Concatenation
- Python: if Statements and Comparison Operators
- Python: else and elif statements
- Python: Testing Multiple Conditions
- Python: Testing Sets of Conditions
- Python: Nested if Statements
- Python: Lists
- Python: Adding To and Changing Lists
- Python: Lists: Take a Slice, Delete Elements, Popping Elements
- Python: Tuples
- Python: for Loops
- Python: Nested for Loops
- Python: Capturing and Formatting User Input
- Python: Dictionaries
- Python: Functions
- Python: While Loops
- Python: Data Files
- Python: Using Pexpect
- Python : Using Pexpect : ftpTestOffload.sh
- Python : Using Pexpect: ftpTest.py
- 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:
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:
And if you prefer video, this one is great for illustrating the points of difference (and argument). Especially note the comments:
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:
Now you’re ready to follow this video on using both the python shell and idle commands:
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:
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:
You’ll find it handy to have two terminal windows open, one for Nano and the other to run your code.