A text editor is a way to edit files. This is the primary tool that programmers work with - so often people have strong opinons about them.
You should feel free to experiement with a variety of editors - but any modern text editor is good enough for now. Most students in CS61A use Sublime Text (http://www.sublimetext.com) - so that’s what we’re going to work with.
Common text editors include Sublime Text, Vim, Notepad++, Emacs
You might hear about Vim from other programmers - it’s simply a command line based editor (runs in the terminal) that takes advantage of modes (insert vs. scroll) and keyboard shortcuts. It has a high learning curve so we’re not going to cover it in this class.
Bad text editors (Avoid these!): Notepad.exe, TextEdit (on mac), Microsoft Word, IDLE, Python Interactive Mode.
You can install plugins to make things easier.
View all the files in the directory so you can switch easily!
You can drag and drop folders/files into sublime text
Using the keyboard is faster than using the mouse or scrolling. Trying to find that function? Why scroll through when Sublime will find it for you.
Press Command/Control - P to open up the window and type ‘@’ followed by your function name. Sublime will automatically take you there.
You can also search for different files in the same folder with the same command - just press Command/Control - P and the name of hte file
Use the find command for more. Command/Control-F.
The terminal is an interface to work with your computer. Many years ago, the terminal was the only way to interact with a computer. Eventually, computers became powerful enough to support a display and the idea of a desktop and visual interface become possible. You might traditionally use your mouse to navigate around your files or to launch an application, but you can do all of that through the terminal. It’s your text-based interface to your computer.
Task | Command |
---|---|
Open Folder | cd |
List files | ls |
Run python | python |
SSH stands for secure shell. It’s a way to connect to another computer. With SSH you have a direct interface to the remote computer and your terminal is now a terminal to the remote computer. Any programs you run will be on the remote computer, not yours. The files you see when you are connected are the files on the remote computer, not yours.
Once you leave SSH you will be back to your own computer.
A common setup is to have your terminal next to your text editor so you can type into your editor and then run commands in your terminal.
The theme is called Solarized Dark. (http://ethanschoonover.com/solarized)
OSX Terminal: https://github.com/tomislav/osx-terminal.app-colors-solarized Sublime Text: https://github.com/SublimeColors/Solarized (Follow the instructions)
$ python3 -i
Python 3.4.1 (default, May 19 2014, 13:10:29) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin Type “help”, “copyright”, “credits” or “license” for more information.
>>> print("hello world")
hello world
$ python3 file.py
hello world