Changes

Jump to: navigation, search

OPS435 Python Lab 1

10 bytes added, 17:06, 15 May 2017
Part 2 - SETTING UP YOUR PYTHON ENVIRONMENT FOR OPS435 LABS
'''Perform the following steps:'''
:#The first step is to update your entire system. <source>
yum update
</source>
:#Install extra packages for enterprise linux<source>
yum install epel-release
</source>
:#Next install applications we need, first Python version 3 and version 2:<source>
yum install python34 python34-devel # Install python3.4 and python3.4 development libraries
yum install python python2-devel # Install python2.7 and python2.7 development libraries
</source>
:#Next, you will install a couple of useful applications called '''tmux''' and '''screen'''. They are referred to as '''terminal multiplexers'''. If you plan to spend a lot of time in the terminal, this powerful tool will help you get it done. Lets install it and plan to use it later:<source>
yum install screen tmux && ln -s /usr/bin/true /etc/sysconfig/bash-prompt-screen
</source>
:# You will now set your hostname to the Linux Distribution we are using:<source>
hostnamectl set-hostname centos7 # Set your hostname to distribution-name
</source>
:#Installing vim(Vi IMproved) will give us syntax highlighting and allow for advanced customization for terminal editing:<source>
yum install vim-common vim-enhanced # Install vim
</source>
:#Python pip is a package manager specifically for Python. While it is usually not recommended to install software outside of dnf or yum, sometimes the only way to get a specific or latest version will be through pip:<source>
yum install python-pip # Install python2.7 pip
yum install python34-pip # Install python3.4 pip
yum install git # Install git command line tool
</source>
:#IPython will be one of the tools we will use the most. Lets install it. You will learn more about it in the next section:<source>
yum install python-ipython # Install ipython for python2.7
pip3.4 install ipython # Install ipython for python3.4
</source>
:#Issue the following commands in your Ipython shell to check your work for this section:<source>
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
python ./CheckLab1.py -f -v lab0b
</source>
:#Before moving on to the next step, make sure you identify and correct any and all errors in "lab1a.py". When the check script tells you everything is "ok", you may proceed to the next step.
<blockquote><blockquote>{{Admon/important|style="padding-left:25px"|Selecting a Text Editor|There are a wide range of text editors for the python language and just about any of them will do. As long as you get basic syntax highlighting and automatic indenting out of the application you are good to go. This section will go over a number of different text editors, showing off a few different text editors so students may find their favourite. There are no wrong answers here, give them all a try and use your favourite.<br><br><blockquote>'''Vim'''<br>As a system administrator you have probably spent a ton of time inside vim. Well vim is just as powerful and useful when you get to programming, all the shortcuts and commands you've learned over the years will help you edit programs efficiently. On top of what you already know, it might be time to customize vim a little more for programming. Vim can actually be modified to become a full programming environment with all the features you you'd expect.</blockquote><br><br>'''Atom'''<br>"A hackable text editor for the 21st Century". This text editor is a powerful tools that comes with everything your need right out of the box. Atom allows for deep customization from everything from complete functionality changes to just changing the theme. Definitely worth checking out, especially for python development.<br><br>'''Sublime'''<br>Insert discussion here}}</blockquote></blockquote>
13,420
edits

Navigation menu