Open main menu

CDOT Wiki β

Changes

OPS435 Online Lab1

77 bytes removed, 21:26, 12 May 2020
Investigation 2 - Python on Matrix
* To start an interactive Python version 3 shell, type "python3" at the command prompt.
== Task 1 - Setting up Python environment on Matrix for labs and assignments ===== Part I - Python Versions on Matrix ===
:* You can access the Python Interpreter on Matrix from a Linux machine or a Windows 10 machine.
==== Login to matrix.senecacollege.ca from a CentOS 7 machine ====
:* To login to matrix.senecacollege.ca must must have a active Seneca user account.
:* The following is a screen shot showing the login from a CentOS Linux (host or vm) system with an active Seneca user name: <br /><br />[[image:centos_ssh.png|Ssh to matrix from Linux]]
==== Login to matrix.senecacollege.ca from a Windows 10 machine ====
:* Login to matrix.senecacollege.ca with your Seneca user name from Windows 10's run box.<br /><br />[[image:window10_ssh.png|ssh to matrix from Windows 10]]
==== Explore Python versions on Matrix ====
:* Once you are on matrix.senecacollege.ca, run the '''python''' command to start a Python version 2 interactive shell at the command prompt. The last line displayed should be '''>>>'''. the '''>>>''' sign is referred to as the Python interactive shell prompt.
:** python
:* Compare the list of keywords and symbols for Python version 2 and version 3. Which keyword(s) is/are remove from version 2 in version 3?
=== Part II - Create directory structure for Labs and Assignments ======= Create directory structure using BASH commands====
:* Lets setup and reserve the following directories for storing and organizing files for labs and assignments. Execute the following commands at the command prompt:
<pre>
</pre>
==== Verify the directory structure created ====
:* Download the sample.py script from https://github.com/rayfreeping/ops435-lab1 repository to ~/ops435/lab1 directory
:* Study and Explore the sample.py python script and identify the following sections:
:** <source>python3 sample.py test 2>/dev/null </source>
== Task 2 Investigation 3 - exploring and using Python's built-in functions ===== Part I - Interactive (leaning) mode: using the Python Interactive Shell ===
:* In this mode, you can instruct the Python Interpreter to execute python statement or python expression one at a time, call a function, or display the representation of a python data object.
:* To start the Python version 3 Interactive shell, type the command <source>[raymond.chan@mtrx-node05pd lab1]$ python3</source> at the Linux command prompt.
</source>
=== Part II - Script (execution) mode: creating Python script ===
:* print() function
== Task 3 Investigation 4 - exploring Python's built-in data objects ==
:* integer object
:* string object
== Task 4 Investigation 5 - exploring on how to get Python to do maths ==
:* Math operators
1,760
edits