Fixing some common shit

>In windows, python points to the store

>Backward Compatibilty

>Multiple Versions Dilemma

Python Basics

>Python Language vs Implementations

>How is Python code executed?

import sys
def doesexist():
	print("hello")

if len(sys.argv) > 2:
		doesntexist()     #Python will not even raise an exception here until the number of arguments is greater than two
else:
		doesexist()

![- The bytecode is independent of the machine we're running on.

import py_compile
py_compile.compile("script")

zrax/pycdc

>PEPs (Python Enhancement Proposals)

PEP 0 -- Index of Python Enhancement Proposals (PEPs)

>Running Pythonic code

#From the command line
python3 -c "print('Hello world')"

#By using scripts, passing .py or .pyc scripts to the Python interpreter
python3 script.py

By using the Python shell for quickly writing and testing code snippets and the Python history during this shell is stored in ~/.python_history
python3

Proper Script Structure

>Defining the encoding

Python assumes ASCII by default, if not provided otherwise.

#-*- coding: UTF-8 -*-

>Defining the interpreter path using shebang

We must define the interpreter path, which will be used if the file is run via a relative path

#!/usr/bin/env python3

>Code indentation error if wrongly formatted

Stop with an error if the code is formatted with both spaces and tabs
**#!/usr/bin/env python3 -tt**

Generate a warning when both tabs& spaces are used for indentation
**#!/usr/bin/env python3 -t**

>Comments and Docstrings

#This is a single line comment

"""
This is a 
multi line comment, or call em docstrings
"""
def func():
	 """This is a function that does nothing at all"""
	 return

help(func)
print(func.__doc__)

>Defining main() as we do in C

Some cool shit I learnt

>Base-2 and Base-16 Assignment

>Padding the binary upto 8 places with zeroes if less