Skip to content
Snippets Groups Projects
Commit dfbb59a9 authored by Pat's avatar Pat
Browse files

Added Python Setup Guide as well as some images to go along with it

parent 358304ef
No related branches found
No related tags found
No related merge requests found
img/idlewin.png

34.3 KiB

img/pycharmwin.png

123 KiB

img/vscodewin.png

46.2 KiB

setup.md 0 → 100644
# Python Quick-Start Guide
## What is Python?
Python is a high-level, interpreted programming language. Most of you should be familiar with Java, Python and Java are similair in the sense that they are both high-level. However, Java is a compiled language (meaning that it is turned into CPU instructions before being run) while Python is an interpreted language. Java is also statically typed (Meaning you have to assign a variable type explicitly) while Python is dynamically typed (Python itself decides which variable type you want to use)
## Downloading Python
You can go to [python.org](https://www.python.org/) to download the latest version of Python for your system, installation is pretty simple you just double click the downloaded file and follow the instructions on-screen.
## But how do I begin?
You don't *really* need anything other than a text editor to begin developing in Python. In the end as long as you have a text file with the correct text in it (and the correct file extension) the python interpreter will be able to run it which you can do from the terminal like so:
![Python running in the Command Line](https://gitlab.cis.strath.ac.uk/xgb21195/cs101-csai/-/raw/main/img/pythoncmd.png?ref_type=heads)
## Ok but... I don't want to use Notepad for this
That's fair enough, just because you *can* do something doesn't mean you *should*. Editing with Notepad is a hassle that you probably don't need. Fortunately, Python has many IDEs (Integrated Development Environments, Think Eclipse, NetBeans, IntelliJ from your Java classes). Here are a couple that I know about, but if you Google around I'm sure you can find more.
### IDLE
IDLE is a very, very simple IDE that comes with every Python installation, if you have downloaded Python then you have downloaded IDLE. It gives you some basic IDE features like syntax highlighting and running the code but it's not that useful for anything more than learning to code.
![IDLE running on Windows](https://gitlab.cis.strath.ac.uk/xgb21195/cs101-csai/-/raw/main/img/idlewin.png?ref_type=heads)
### Visual Studio Code (VSCode)
VSCode is a code editor developed by Microsoft that is known for it's wide compatibility with lots of different programming languages. It's core strength is consistency when developing in lots of different languages at once but it suffers from not being specialised.
![VSCode Running on Windows](https://gitlab.cis.strath.ac.uk/xgb21195/cs101-csai/-/raw/main/img/vscodewin.png?ref_type=heads)
#### To get set up on Python in VSCode:
- Install Python:
- Ensure Python is installed on your system.
- [python.org](https://www.python.org/)
- Install VS Code:
- Download and install Visual Studio Code.
- [code.visualstudio.com](https://code.visualstudio.com/download)
- Open VS Code:
- Launch the application.
- Install the Python Extension:
- Go to the Extensions view by clicking on the square icon on the sidebar
- Search for 'Python'.
- Install the Python extension by Microsoft.
- Open Your Python File:
- Open the folder containing your script or create a new Python file.
- Run the Script:
- Right-click in the editor and select "Run Python File in Terminal"
- or
- Use the play button on the top-right corner of the editor. This will execute the script in the integrated terminal.
### PyCharm
PyCharm is a highly advanced IDE created by JetBrains. It will be very familiar to those of you who are used to working with IntelliJ, it has a lot of features designed to make developing in Python easier (such as more powerful AutoComplete, integration with Git). [As Strathclyde Students, you even get access to the more powerful version of it for free](https://www.jetbrains.com/community/education/)!
Getting started is very simple, make sure you have Python installed go to [jetbrains.com/pycharm](https://www.jetbrains.com/pycharm/download/) and download it from there.
Once it's installed you can just follow the on-screen instructions to make a new project and press on the green play-button to run it.
# Using Python
I'm gonna throw up a second file that goes through basic Python syntax very soon, either later this evening or tomorrow morning. In the meantime I hope this small write up and the video have helped you in some way. Good luck with the labs, if you have any questions:
[pat.prochacki@strath.ac.uk](mailto:pat.prochacki@strath.ac.uk)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment