Denna sida finns bara på engelska.
The programming language Python is used in programming courses and several projects here.
Version 2 or 3
The standard version (
/usr/bin/python) in Centos 7 is
2.7, but our locally modified path is changed so that
python runs Python 3.6.
There are some incompatible changes in Python version 3, so that some programs can only be run in Python 2 or only in Python 3.
python3 you can explicitly run
one of the either.
(If you want to to use the Idle environment
it is started with
respectively. The latter is also found in the Applications menu.
Also there is
ipython2 as well as
Several packages are installed here, besides the standard Python packages. Some of them are listed here, but it is not a complete list. If you need to use some package here, first just try if it already is available!
TextBlob is a library for processing textual data which makes some tasks easier to do than most alternatives. See here!
NLTK – Natural Language Toolkit – contains several program modules and corpuses for research and education in NLP and is installed here.
There is an accompanying book, Natural Language Processing with Python, which starts as a beginner’s instruction in Python that uses language technology examples from the start.
Language models for English and French have been installed, and can be
Installing packages with pip
One way to install Python packages is with pip.
pip3 depending on whether it
is for Python2 och Python3.
pip in normal usage assumes that you are a system
administrator and are going to do a system-wide installation for
everyone. You can’t do that.
To instead do a personal installation for just you, use the
$ pip3 install --user inflect
Using cached inflect-2.1.0-py2.py3-none-any.whl
Installing collected packages: inflect
Successfully installed inflect-2.1.0
Python 3.6.6 (default, Aug 13 2018, 18:24:23)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inflect
>>> p = inflect.engine()
Some packages will install programs for you to run. With a personal
installation they will be in
will be found in your PATH.
pyflakes can find some errors in programs,
like invalid syntax and undefined variables.
It can be run with Python→Check File in the Emacs menus
for a Python file.
pycodestyle checks if a Python program follows the
style guide PEP 8.