Changes

Jump to: navigation, search

OPS435 Python Lab 1

2 bytes added, 07:28, 18 May 2017
Creating the introductory "Hello World" Script
:#Save the file and quit vim. We will now go over the process of manually running this python script. Both in the Bash shell and in the IPython shell.
:#Now lets try running the script directly from the IPython shell by issuing the follwoing commands:<source>
% run ~/ops435/lab1/lab1a.py</source><br><br>Your python script should have run, if you have any errors you should check that you typed the script in exactly. Be careful of extra spaces, symbols, letters, or lowercase/uppercase differences.<br><br>
:# Issue the following command to exit your ipython session:<source>
exit
</source>
:#Now, from the Bash shell we will give it the correct Linux permissions in order to run your newly-created python script. This is just showing the multiple ways you can use this python script. You are not required to have IPython running on a system, however hopefully we can use IPython's powerful features to our advantage.
</source>
:#Download the check script and check your work. Enter the following commands from the bash shell.<source>
cd ~/ops435/lab1/ 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 matrix.senecac.on.ca/~acoatley-willis/CheckLab1.py python ./CheckLab1.py -f -v lab1a
</source>
:#Before moving on to the next step make sure you identify any and all errors in "lab1a.py". When the check script tells you everything is "ok", you may proceed to the next step.
13,420
edits

Navigation menu