Changes

Jump to: navigation, search

OPS435 Online Lab1

2,607 bytes added, 17:19, 17 September 2020
Part I - Python Versions on Matrix
[[Category:rchan]][[Category:OPS435-Online]]
'''Introduction to git, github.com, and Python - Under Construction - Not finalized yet.'''
= Lab Objectives =
:* Using the "git clone" command to clone a repository into a new directory
</pre>
:* Make sure that gitlog.txt and repo_tree.txt are not empty and are under the ~/ops435/lab1 directory. Review and study the contents of gitlog.txt and repo_tree.txt
 
:*Download the check script and check your work. Enter the following commands from the bash shell.<source lang="bash">
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
ls -l lab1a.py #confirm that you have the directory for you github repo, the files gitlog.txt and repo_tree.txt
ls CheckLab1.py || wget https://ict.senecacollege.ca/~raymond.chan/ops435/labs/LabCheckScripts/CheckLab1.py
python3 ./CheckLab1.py -f -v lab0a
</source>
= Investigation 2 - Python 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 ===
:<font color='red'>This option won't work after September 1, 2020 as matrix.senecacollege.ca had been moved under Seneca's VPN. The latest version of the openconnect client is need to connect to the Seneca VPN. We are working on the instruction on how to do that. In the mean time, please use the Windows 10 as described below to connect to matrix.</font>:* To login to matrix.senecacollege.ca must you 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 ===
:* Please follow the instruction at [https://inside.senecacollege.ca/its/services/vpn/studentvpn.html Seneca Student VPN] to download and install the GlobalProtect VPN client and connect to the Seneca VPN to your Windows 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]]
:** <source>python3 sample.py 2>/dev/null</source>
:** <source>python3 sample.py test 2>/dev/null </source>
:*Download the check script and check your work. Enter the following commands from the bash shell.<source lang="bash">
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
ls -l ~/ops435/ #confirm that you have create the directory structure under ~/ops435
ls CheckLab1.py || wget https://ict.senecacollege.ca/~raymond.chan/ops435/labs/LabCheckScripts/CheckLab1.py
python3 ./CheckLab1.py -f -v lab0b
</source>
= Investigation 3 - exploring and using Python's built-in functions =
=LAB 1 SIGN-OFF Upload the following files individually to Blackboard=
:* gitlog'''Run the CheckLab1.py script and capture the result'''<source>python3 ./CheckLab1.py -f -v &> lab1_[seneca_id].txt</source> : contains Submit the output of the command "git log" from Task 3following files individually to Blackboard::* repo_tree.txt: contains the output of the command <span style="tree color:green;font-asize:1.5em;" from Task 3>&#x2713;</span> <code>lab1_[seneca_id].txt</code>:* lab1_check.txt: contains the output of the command <span style="python3 color:green;font-size:1.5em;">&#x2713;</checkLab1span> <code>gitlog.txt, repo_tree.txt, lab1a.py, lab1b.py lab1c.py -f -v", lab1d.py</code>
= Lab Review =
:# What is the name of the definitive branch in a git repository?
:# What is a "pull request" related to a branch in a git repository?
:# Write Python code that when run, will perform the following tasks:<ol type="a"><li>Contain a she-bang line</li><li>Display a greetings message to the user</li><li>display an empty line ('''hint:''' use the special character '''\n''' to print the a new-line character)</li><li>Display text, '''"Your current directory is:"''' (You are NOT required to display quotation marks)</li><li>Display the current working directory pathname (using an appropriate command)</li><li>Display another empty line</li></ol>
:# How do you execute a Python script when you are within the interactive <u>python3</u> shell? (Hint: make use of a function provided by the os python module.)
:# How do you execute a Python script when you are in the <u>Bash</u> Shell (i.e. NOT within the python3 shell)?
:# Write the pipeline command to check if the CheckLab1.py checking script exists, and download it from the location:<br>https://ict.senecacollege.ca/~raymond.chan/ops435/labs/LabCheckScripts/CheckLab1.py
1,760
edits

Navigation menu