Now that you've learnt what algorithms are, how to represent them, and a little about the Python programming environment, it's time to learn a little more about Python. There are plenty of free courses, resources and books out there, so there are no excuses. There is also plenty of opportunity to program in the courses on The Computing Café but you will still need to do a lot of work on your own.
Standard Python
Grab Python from the Python website (use version 3.5+ for increased compatibility)
When you are installing Python, make sure that you opt to add Python to the 'path'. After Python has installed, make sure it works by starting up IDLE (the built in development environment) from the start menu - you might not know what to do yet, all will be revealed later! To install the rest of the useful packages, you need to use a 'command window' (probably as an Administrator) which you can start by typing 'cmd' in the 'Search programs and files' box on the Windows start menu. Type 'cd c:\' and press the ENTER key on your keyboard before you perform the next steps. First, install Numpy by typing '
pip install numpy ' at the command prompt and pressing ENTER . Python should finish with 'Successfully installed numpy-x.x.x '. Test your Numpy installation in IDLE ...>>> import numpy >>> numpy.version.version Next, install SciPy by typing '
pip install scipy ' at the command prompt and pressing ENTER . Python should finish with 'Successfully installed scipy-x.x.x '. Test your SciPy installation in IDLE ...>>> import scipy >>> scipy.version.version It seems that you have to download the correct PyQT4 bindings and can't install them directly using 'pip'.
Download the PyQT4 binding for your version of Python, move the '
whl ' file onto the C: drive and install it by typing 'pip install pyqt_filename ' at the command prompt and pressing ENTER . Python should finish with 'Successfully installed PyQT4-x.x.x '. Unfortunately, this version of PyQT does not seem to install start menu shortcuts but you can find shortcuts to the two application you need in C:\Program Files\Python35\Lib\site-packages\PyQt4 - make shortcuts to 'assistant.exe' and 'designer.exe' and pop them in the Python start menu folder. Test your PyQt4 installation in IDLE ...>>> from PyQt4.QtCore import QT_VERSION_STR >>> QT_VERSION_STR Install Matplotlib by typing '
pip install matplotlib ' at the command prompt and pressing the ENTER key. Python should finish with 'Successfully installed matplotlib-x.x.x ' amongst other dependencies. Test your Matplotlib installation in IDLE ...>>> import matplotlib >>> matplotlib.__version__ # There are four underscores! Install PyGame by typing '
pip install pygame ' at the command prompt and pressing the ENTER key. Python should finish with 'Successfully installed pygame-x.x.x '. Test your PyGame installation in IDLE ...>>> import pygame >>> pygame.version.ver Install Notepad++
Finally, even though Python comes with it's own 'development environment' called 'IDLE', it's well worth installing Thonny. From the command prompt, type ' pip install thonnyapp ' and press the ENTER key. Python will download and install Thonny and a separate shortcut to the editor, hopefully responding with 'Successfully installed thonnyapp-x.x.x '. If you don't get a shortcut to start Thonny on the Windows start menu, you can find the executable in the ...[Python install directory] > Scripts > Thonny.exe You should be able to successfully rerun the tests you performed earlier (or checkout all the installed packages from 'Tools > Manage Packages').
Ask your teacher then!
WinPython
Alternatively (and preferentially), you could install WinPython, a completely PORTABLE Python installation which comes in a full version with literally hundreds of libraries already installed or a 'zero' version into which you can install your own. I'm going to go for the zero version and install all the required libraries myself so I know what's there.
Visit the WinPython homepage and click the 'Download' button next to the version of WinPython you wish to use (choose the 32 bit version for increased compatibility). This will take you to the Sourceforge page for WinPython - make sure you download the 32 bit 'Zero' version which will download as an 'exe' installer. Save this to your desktop or userspace.
Double click the installer, choose 'Run' and click through the dialogues accepting the default options. You should be left with a folder in the same location as the installer with the name WinPython-32bit-?.?.?.?Zero where the '?' will be different depending on which version you have downloaded. I have renamed the folder to 'WinPython' but you can leave it like this if you want. You can now safely delete the installer.
WinPython Zero ships with shortcuts for all the tools but we can safely delete the ones we don't want. We've got enough programming environments and Spyder uses PyQT5 which doesn't work well with some of the GUI development tools we use. Open up the WinPython folder and delete ...
You should be left with ...
Install Numpy
Open up the 'WinPython Command Prompt' and type '
pip install numpy ' and pressing the ENTER key. Wait for the installation to complete and then test your numpy installation in IDLEX by typing ...>>> import numpy >>> numpy.version.version Back in the 'WinPython Command Prompt', type '
pip install scipy ' and press the ENTER key. Wait for the installation to complete the then test the installation by typing the following in IDLEX ...>>> import scipy >>> scipy.version.version Download the PyQT4 binding for your version of Python, move the '
whl ' file onto the 'scripts' directory in the WinPython folder and install it by typing 'pip install pyqt_filename ' at the 'WinPython Command Prompt' and pressing the ENTER key. Wait for the installation to complete and then test your PyQT4 installation in IDLEX ...>>> from PyQt4.QtCore import QT_VERSION_STR >>> QT_VERSION_STR Type '
pip install matplotlib ' in the 'WinPython Command Prompt' window to install Matplotlib and its dependencies. Wait for the installation to complete and then test your Matplotlib installation in IDLEX ...>>> import matplotlib >>> matplotlib.__version__ # There are four underscores! Type '
pip install pygame ' in the 'WinPython Command Prompt' window to install Pygame. Wait for the installation to complete and then test your Pygame installation in IDLEX ...>>> import pygame >>> pygame.version.ver Type ' pip install jupyter ' in the 'WinPython Command Prompt' window to install Jupyter Notebook - a beautiful interactive Python programming environment. Test your Jupyter Notebook installation by double clicking the 'Jupyter Notebook' icon in the root distribution folder. You should see a command windows open up and then a browser window with the actual notebook.Jupyter notebook Type ' pip install jupyterlab ' in the 'WinPython Command Prompt' window to install Jupyter Lab software - a more powerful (but probably less useful to us) scientific Python programming environment. Test your Jupyter Lab installation by double clicking the 'Jupyter Lab' icon in the root distribution folder. You should see a command windows open up and then a browser window with the actual lab.Jupyter Lab There are plenty of other useful libraries that you can install into either a standard Python Installation or into a portable WinPython installation including ...
... and I'll add to the list as I find more!
Grab yourself some free 'books' from the World Wide Web ...
Enrol on an online course to help you learn
The list is endless, but here are a few of the best ...
PythonByteSize - over one hundred free video tutorials on Python 3 from basics to some really advanced stuff suitable for A Level and beyond. Lots of the videos are concerned with programming Graphical User Interfaces using the Python Tkinter library.
Socratica - 30 or so videos which give you a quick (and humorous) introduction to Python
CS Dojo - Introduction to Python programming for absolute beginners. CK uses Jupyter Notebook to teach this online course; look back to the installation instructions for WinPython which might be a little easier than installing through the Anaconda Package Manager ...
Learn to Code GCSE - Brilliant series outlining all the basic and more advanced techniques used to learn to program in Python for GCSE level and beyond. There are currently four playlists to choose from ...
|
Learn to program >