Open main menu

CDOT Wiki β

Changes

OPS435 Online Lab1

193 bytes added, 14:54, 6 May 2022
Investigation 5 - exploring on how to get Python to do maths
[[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
:* Open a pull request, and
:* Merge your pull request
: Please make the following <font color='red'>changes </font> when following the guide::* name the new repository using your <b><u>Seneca user name </u></b> instead of "hello-world".
:* add your full name, and OPS435 section to the README file, do not post any other personal information there.
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://ictgithub.senecacollege.cacom/~raymond.chanops435/ops435lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab0a
</source>
== 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 ===
:* 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]]
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://ictgithub.senecacollege.cacom/~raymond.chanops435/ops435lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab0b
</source>
pwd #confirm that you are in the right directory
ls lab1a.py #confirm that you have the lab1a.py script in your directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/~raymond.chanops435/ops435lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1a
</source>
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/~raymond.chanops435/ops435lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1c
</source></li>
cd ~/ops435/lab1/
pwd #confirm that you are in the right directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/ops435/~raymond.chanlab1-template/ops435blob/master/LabCheckScripts/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1d
</source>Before moving on to the next step make sure you identify any and all errors in "lab1d.py".<br><br></li>
=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 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>ipython3python3</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 Ipython3 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