Changes

Jump to: navigation, search

OPS445 Online Lab1

2,887 bytes added, 20:33, 2 May 2023
Option 1: Create a Linux Virtual Machine
= Investigation 1 - Set Up A Development Environment =
== Task 1: Create a Linux Virtual Machine ==
In order to proceed in the course you're going to need a Linux-based development environment. The requirements for this development environment are:
:* it has a text editor with modern development tools installed. (syntax highlighting, linting, etc.)
You have options in how you set this up. If the computer you will be using for this course is powerful and has at least 16 GB of RAM, you will probably want to set up a Virtual Machine. == Option 1: Create a Linux Virtual Machine == We will demonstrate the steps for setting up a Fedora Virtual Machine with Visual Studio Code installed. A [https://youtu.be/Zxt2BKq-vIw short video] is available to walk you through the process.
:* Install Virtual Machine Software such as VMWare Workstation.
:* Download the Fedora Workstation ISO file from [https://download.fedoraproject.org/pub/fedora/linux/releases/34/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-34-1.2.iso The Fedora Website].
:* Enter your name, and a password. Don't forget this password, as you will need it to become root.
== Task 2: = Verify Python ===
Fedora should have the required software (with the exception of VS Code) already installed. We will verify this before moving on.
:* Run '''sudo dnf update''' to update the system software.
== Task 3: = Install Visual Studio Code and Extensions ===
Visual Studio Code has an excellent Debugger for Python, and so it is the recommended editor for this course. However, you may use a different editor at your discretion. Pycharm Community also has a very good debugger, works on Fedora, and is free for students.
:* Launch Visual Studio Code. Click 'Activities' and type 'code', you should see the launcher for Visual Studio Code appear.
:* Now install the Python extension. Press Control+Shift+x to open Extensions in the sidebar. (Or click on the Extensions icon on left side of the window).
:* Type 'Python' into the search bar, and click 'Install' when you find the extension created by Microsoft. You may wish to explore other extensions to customize your workspace.
== Option 2: Use WSL == If your computer has less than 16 GB of RAM and has problems running a full virtual machine, you may choose to use Windows Subsystem for Linux (WSL) instead. This will provide a minimal Linux environment. A [https://youtu.be/FXLrigSSlXI short video] is available to view.:* Open "Windows Store".:* Search for "Ubuntu" and install the app that is published by Canonical.:* Launch Ubuntu from the Start Menu. You will have a terminal-based Linux interface only. To access your Windows files, type <code>cd /mnt/c</code>. This will get you to the top of your Windows C drive. === Verify Python on Ubuntu === Ubuntu should have the required software (with the exception of VS Code) already installed. We will verify this before moving on.:* Enter the command '''python3 --version''' and verify that the installed version is at least '''python 3.4'''. If no version of Python is installed, run '''sudo apt install python3'''.:* Enter the command '''git --version''' and verify that the installed version is at least '''git 1.2'''. If no version of Python is installed, run '''sudo apt install git'''.:* Run '''sudo apt update && sudo apt upgrade''' to update the system software.  === Verify Python on Windows ===:* Open your Windows command prompt and type '''python --version'''. If no version of Python is installed, it should give you instructions in how to install it, or go to [https://www.python.org/downloads/ the Python Homepage]. === Install VS Code ===:* Follow the instructions to [https://code.visualstudio.com/download install VS Code on Windows]. Now you will be able to complete most tasks on Windows, and switch to a minimal Linux environment when needed. == Task 4: Verify The Python Interpreter ==
'''A few background information about the Python programming language
* The Python Interpreter understanding the Python language and this is why we are going to learn this programming language in this course.
* To exit from the interactive Python shell, press Ctrl+d.
== Task 5 - : 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:
:* Start your web browser and go to github.com and use your own email to sign up for a new github account if you don't already have one. <br /><b>[Note: Please be aware that Seneca's spam filter block email from github.com by default, if you use your Seneca email to sign up for an account on github.com, you might have to re-configure your email spam filter to allow confirmation email from github.com to reach your inbox.]</b>
=== Task 2: Add your public key to Github ===:Follow the Github guide [https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account here] to add your public key to your profile::* Add one public key for each computer/VM you will be using for the course. :* Run <code>ls -la ~/.ssh</code> and look for a public key file such as <b>id_rsa.pub</b>. If no file exists, generate a new keypair using <code>ssh-keygen</code>.:* Use <code>cat <public key filename></code> to display the contents of the public key, and then select and copy the text.:* Open Github in your web browser. Log in, select <b>Settings</b> -> <b>SSH and GPG Keys</b>. Create new key, and paste your public key contents into the text box.:You will now have permission to clone repositories using <b>SSH</b>. === Task 3: Create a project and make a pull request on GitHub ===
:Follow the Github "Hello World Guide" [https://guides.github.com/activities/hello-world/ here] to perform the following activities:
:* Create a repository
:* add your full name, and OPS445 section to the README file, do not post any other personal information there.
=== Task 34: Clone a Github.com repository into a new directory on a Linux system ===
If your professor is asking you to submit labs on GitHub, follow their instructions now to clone the lab1 repository.
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/~eric.brauersenecaops445/ops445lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1a
</source>
cd ~/ops445/lab1/
pwd #confirm that you are in the right directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab1-template/labsblob/CheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1b
</source></li>
cd ~/ops445/lab1/
pwd #confirm that you are in the right directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab1-template/labsblob/LabCheckScriptsmaster/CheckLab1.py?raw=true' -O CheckLab1.py
python3 ./CheckLab1.py -f -v lab1c
</source></li>
cd ~/ops445/lab1/
pwd #confirm that you are in the right directory
ls CheckLab1.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab1-template/labsblob/LabCheckScriptsmaster/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>
:'''Run the CheckLab1.py script and capture the result'''
<source>python3 ./CheckLab1.py -f -v &> lab1_yoursenecaid.txt
git add lab1*lab1_yoursenecaid.txt
git commit -m "completed lab"
git push

Navigation menu