Вы находитесь на странице: 1из 25

1

WWW.PENTALOG.COM
Install Python 3.x

Windows
• download python from - https://www.python.org/downloads/

WWW.PENTALOG.COM
Install Python 3.x

Debian/Ubuntu Linux
• sudo apt-get update
• sudo apt-get install build-essential
• sudo apt-get install python3 python3-pip python3-dev

macOS
• install Homebrew - https://brew.sh
• brew install python3

WWW.PENTALOG.COM
Python Interpreter (REPL)

WWW.PENTALOG.COM
PIP (package manager)
• pip install <some-package-name>
• pip uninstall <some-package-name>

IPython
• pip install ipython
• ipython

WWW.PENTALOG.COM
The Jupyter notebook
Installation
• pip install jupyter
• jupyter notebook

WWW.PENTALOG.COM
7

WWW.PENTALOG.COM
8

WWW.PENTALOG.COM
The Jupyter notebook

Configure starting path


• jupyter notebook --generate-config
• <open> ~/.jupyter/jupyter_notebook_config.py
• add the following line to the end of file:
○ c.NotebookApp.notebook_dir = u'<path>'

WWW.PENTALOG.COM
Python Coding Style (PEP8)
https://www.python.org/dev/peps/pep-0008/

● 4 spaces indentation
● 79 characters per line
● spacing⎵=⎵‘very⎵‘⎵+⎵‘important‘

● lower_case_with_underscores
● ClassName
● _single_leading_underscore
● __double_leading_underscore

10

WWW.PENTALOG.COM
Python Text Editors & IDEs

● Sublime
● Atom
● Vim
● Emacs

● PyCharm
● PyDev
● Ninja IDE

11

WWW.PENTALOG.COM
Python debugger (PDB)
● import pdb • n(ext) - execute the current
● pdb.set_trace()
OR
statement(step over).
● import pdb; pdb.set_trace() • s(tep) - execute and step
into function.
• r(eturn) - continue execution
until the current function
returns.
• c(ontinue) - continue
execution until a breakpoint
is encountered.
• u(p)/d(own) - move one
level up/down in the stack
trace.
12

WWW.PENTALOG.COM
• numbers
• string
Python data types • list
• tuple
• dictionary

13

WWW.PENTALOG.COM
Python basics
• print()
• input()

14

WWW.PENTALOG.COM
Python basics
• print()
• input()
• if/elif/else

15

WWW.PENTALOG.COM
Python basics
• print()
• input()
• if/elif/else
• while
• break

16

WWW.PENTALOG.COM
Python basics
• print()
• input()
• if/elif/else
• while
• break
• for
• range()
• continue

17

WWW.PENTALOG.COM
Python basics
• print()
• input()
• if/elif/else
• while
• break
• for
• range()
• continue
• sys.argv

18

WWW.PENTALOG.COM
GIT
https://git-scm.com

• version control system


• free and open source
• shared repository
• branching and merging

19

WWW.PENTALOG.COM
GIT commands
https://git-scm.com/doc

• init
• clone • add
• commit
• push
• pull

20

WWW.PENTALOG.COM
21

WWW.PENTALOG.COM
GIT Clients

• SourceTree
• Git GUI
• Gitk

22

WWW.PENTALOG.COM
Bitbucket
• web-based hosting service for projects
• written in Python using the Django web framework

23

WWW.PENTALOG.COM
Q&A

24

WWW.PENTALOG.COM
25

WWW.PENTALOG.COM

Вам также может понравиться