Open main menu

CDOT Wiki β

Changes

OPS445 Online Lab1

1,960 bytes removed, 19:35, 31 August 2021
Investigation 3 - git and github.com
== Task 3: Clone a Github.com repository into a new directory on a Linux system ==
: You can do the following steps either on matrix.senecacollege.ca or on your CentOS 7 vm::* login to matrix.senecacollege.ca or your CentOS 7 vm:* create a directory named ops445/lab1 under If your home directory:* change your working directory to ~/ops445/lab1:* run the following git command to clone the repository you created in Task 2 on github.com<pre> git clone https://github.com/[your_github_user_name]/[your_seneca_user_name]</pre>:for example, if your github user name professor is <b>rc2030</b>, and your seneca user name is <b>rchan</b>, the git command to clone the repository asking you created in Task 2 should be:<pre> git clone https://github.com/rc2030/rchan</pre>:* change your working directory to your cloned git repositorysubmit labs on GitHub, which should be ~/ops445/lab1/[your_seneca_user_name]:* run the following two commands and capture follow their output instructions now to clone the named files:<pre> git log > ~/ops445/lab1/gitlogrepository.txt</pre>
<pre> tree -a > ~Otherwise, download the sample.py script from https:/ops445/lab1github.com/repo_tree.txt<rayfreeping/pre>:* Make sure that gitlog.txt and repo_tree.txt are not empty and are under the ops435-lab1 repository to ~/ops445/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 ~/ops445/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/ops445/labs/LabCheckScripts/CheckLab1.py
python3 ./CheckLab1.py -f -v lab0a
</source>
 
 
 
 
=== Verify the directory structure created ===
:* Download the sample.py script from https://github.com/rayfreeping/ops435-lab1 repository to ~/ops445/lab1 directory
:* Study and Explore the sample.py python script and identify the following sections:
:** the shebang line
:** the script level doctstringdocstring
:** the import section to import functions from the standard library module
:** the function definition section
:* Also identify the following items appear in the sample.py script:
:** the Python keywords
:** the decision code segementsegment
:** the looping code segment
:** the run time error (exception) handling code segment
:** <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 ~/ops445/lab1/
pwd #confirm that you are in the right directory
ls -l ~/ops435/ #confirm that you have create the directory structure under ~/ops445
ls CheckLab1.py || wget https://ict.senecacollege.ca/~raymond.chan/ops445/labs/LabCheckScripts/CheckLab1.py
python3 ./CheckLab1.py -f -v lab0b
</source>
= Investigation 3 - exploring and using Python's built-in functions =