Introduction

About me

Name: Iva E. Popova

First PC: Правец 8А
First OS: DOS
First Programming Language: BASIC
First technical schools: УКТЦ по МТТ, гр. Правец
First Cat: black and yellow eyed

What I've used Python for?

Back-End Web Development.
Data scraping, analyses and transformation.
Natural Language Processing, opinion mining.

Tech skills

HTML, CSS, JavaScript, React.js, Vue.js,...
Python, Perl6, Perl5, C++, Prolog.
GraphDB, MongoDB, MySQL/Postgre.
RDF, WordNet.
Knowledge representation, ontologies.

Teaching Experience

Technical University:
Programming languages
Internet Programming
Discrete Mathematics
Artificial Intelligence and Expert Systems
IT-Academy:
HTML, CSS
ProgressBG:
Front-End Development
MySQL
Python

Course intro

Course Email

progressbg.python.course@gmail.com
use it to submit your HW
ask any questions

Python intro

picture source: @imgur.com
from If programming languages were essays...

History

Creator: Guido van Rossum
Named after Monty Python's Flying Circus comedy show.
Python 1.0 - January 1994
Python 2.0 - October 2000
Python 3.0 - December 2008

What's the use of Python?

Python is a general-purpose programming language, used for:
System administration (incl. cloud)
Embedded devices
Web and Internet Development
Mobile apps development
Data Science, Big Data, Machine Learning
Scientific computing
Education

Python implementations/distributions

CPython - the official Python distribution.
PyPy - faster and compliant with Python2 and Python 3
Jython - Python for the Java Platform.
IronPython - the Python programming language for the .NET Framework.
Pyjs - contains a Python-to-JavaScript compiler, an AJAX framework and more.

Setting up Python (on Windows, Mac, Linux)

Install Python on Windows - HowTo

Download the Installer:
Python Releases for Windows
Select 32-bit and 64-bit versions according to your system
Customize installation:
installation location:
C:/Python27 or
C:/Python36
Select "Add Python to PATH"

If you don't have a convenient terminal install gitbash for windows, which is included in the git for windows package.

Install Python on Windows - more info

How to Install Python on Windows @howtogeek.com
Using Python on Windows @docs.python.org

Install Python on Mac - more info

Using Python on a Macintosh @docs.python.org

Install Python on Linux

Using Python on Linux @docs.python.org

Verify installation:

Open a command prompt and type:

					# check for python installed version:
					python --versions					

					# check for pip installed version:
					pip --version
				

Let's get dirty - write your first Python script (using IDLE).

Open your Python's IDLE
Write down next code (put your names in the quotes) and hit enter:

			first_name = "Iva"
			last_name = "Popova"
			print(first_name + last_name)
		

Python IDEs and text editors

JetBrains' PyCharm
Download free community edition
Sublime Text 3
More on using Sublime Text with Python: Setting Up Sublime Text 3 for Full Stack Python Development
Visual Studio Code
More on using VS Code with Python: Python in Visual Studio Code

Write Python in VS Code

Prepare your Workspace

Make a root folder for your python project.
Open vscode.
Select "Add folder" and choose the folder you've made.
In the sidebar, the "Explorer" will show your folder.
Save your workspace (you can use the same name as the project)
Menu=>File=>save Workspace As...

Prepare your Workspace

Your Workspace should look like:

Create and execute a Python file

Right click on the root folder in VS Code Sidebar.
Select: "New File", enter the name: say_hello.py and press enter.
Write down this code (put your name in the quotes):

				my_name = "Iva"
				print("Hello " + my_name)
			
Right click anywhere on the editor window and select "Run Python File in Terminal".
Note, this command will be present, only if you've been installed the extension: python by microsoft

A terminal panel should be opened in your editor showing the python script execution and its output:

Select Python version

ctrl+shift+p and find Python: Select interpreter

Useful Keyboard Shortcuts

KeysAction
ctrl+shift+pOpens Command Palette
ctrl+sSave file
ctrl+`Toggle Terminal/Output panel
ctrl+zUndo what you've typed
ctrl+lWhile in terminal will clear the output

Command Palette gives you access to all VS commands in the given context.

Useful videos

How to Install Python with Visual Studio Code [2018] by Jason E.

Useful videos

VS Code - Setup and Basics by Visual Studio Code

Useful videos

Visual Studio Code Intro & Setup by Traversy Media

Useful Readings

Python in Visual Studio Code @code.visualstudio.com
How to use bash on Windows from visual studio code integrated terminal? @stackoverflow

What's in a program

If we make an analogy with a natural language:
Bulgarian Python
novel <=> program
paragraph <=> block
sentences <=> instructions
types of sentences (declarative, imperative,...) <=> types of instructions (statements, expressions)
grammar rules (can be ambiguous) <=> grammar rules (could not be ambiguous)

What's in a Python program

A program consists of set of instructions, which are executed by the computer.
In Python, we write each instruction on a new line.
Instructions which performs one task are separated as a block.
In Python the block is not separated by braces, as in other programming languages, but by same indentation of the instructions in it.

These slides are based on

customised version of

Hakimel's reveal.js

framework