- Scripting language (high-level).
- Relatively easy to learn (compared to C, C++, or Java).
- Widely used in many fields (from software development to data analytics).
- Many libraries available.
- Generally faster than R or SPSS.
- Object-oriented programming supported.
- Django framework for web development.
- Pydev with Eclipse
- PyCharm
- Sublime Text
- Spyder
- Emacs
- VIM
- ...
- Markdown supported: can export a well-styled document to various formats such as a HTML file.
- Line-by-line coding supported. Especially this is useful for data manipulations using Python.
- Graphical libraries can be directly used (while traditional Python IDEs do not provide graphics on its own).
- Code on Jupyter can be exported to a genuine Python file (if needed).
To get you start with Python exercises, this repository has some Python scripts. As you learned from the Git session, try to folk this repository to your account.
- Click
Folk
on this Git repo webpage. - Go to your folked repo page, and copy the address of the repo.
- Open your command line tool.
- Clone your folked repo to your PC using the
git clone
command. - Now, you have all the files from this repository.
- Open your command line tool (e.g., Terminal, Git Shell)
- Go to the folder that you want to work on. In this exercise, you can go to
python/ex1/notebook/
using thecd
command. - Type
jupyter notebook
and hit enter. - Then, a web browser will be automatically opened.
-
In the Jupyter page, click the "new" button, and select "Python 3".
-
Then, a new tab is opened and you are ready for writing Python code.
-
In the block, type:
print ("hello world")
-
Then, hit
Shift + Enter
-
It outputs "hello world".
-
Try typing,
23 + 45
and hitShift + Enter
-
It outputs 68.
Many Python libraries and existing codes available on the Internet are written in Python 2.x, while Python 3.x was introduced long ago. Some syntax and methods are different from each other. So, when using other's code or libraries, make sure that you're using the same version of Python. For today's exercise, we're using Python 3.5 that comes with Anaconda, an open source package that contains useful software for data science.
For advanced users: Anaconda's "Virtual Environment" feature allows you to switch between different Python versions easily on the command line.