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

Python and Visual Studio 2015

Gerald Wright, PhD


Assistant Professor and Program Manager of I.T., Husson University
President, GPW Computer Consulting

Boston Code Camp 25 - Thanks to our Sponsors!


Platinum

Gold

Silver

Bronze

In-Kind Donations

Objectives

Python History
Python Overview
Python Versions
Python Installation
Python Language
Python Packages
Applications

Python History
Guido van Rossum
1989, Christmas project
Monty Pythons Flying Circus
Python 2.0 released October 2000 (2.7 last)
Python 3.0 released December 2008
Python 3.5.1 released December 2015

Python History
Small core functionality
Very large standard library
Highly extensible (packages)

Microsoft
Python Tools for Visual Studio (PTVS)
Supports a number of Python versions
Visual Studio Integrations

Intellisence
Debugging
Editing
Source Control
Open Source

Since Visual Studio 2010

Example

Python Versions Which one is right for you?


Version

Source

Features

CPython

www.python.org

IronPython

ironpython.codeplex.com

native Python
Available in 32 and 64 bit versions
Typically latest features
Best debugging compatibility with
PTVS
Maximum package compatibility
Open-source
Free
Versions 2.7 & 3.5

- .Net implementation
- Best .Net compatibility (C#/F#)
- Some package compatibility
- No mixed (.Net/Python
debugging)

Python Versions Which one is right for you?


Version

Source

Features

PyPy

www.pypy.org

- High-performance JIT
- Less package support
- Less debugging support

IronPython

www.jython.org

- Python on JVM
- Less package support
- Less debugging support

Python IDE Which one is right for you?


IDE

Source

Features

IDLE

www.python.org

- Installs with Cpython


- NotePad

PyCharm

www.jetbrains.com/pycharm/downl
oad/#section=windows

VS 2015

Microsoft

- Full-featured IDE

Canopy?
Anaconda?

JetBrains
Community free
Pro $199/year
Eclipse

- Scientific analysis

Python Language
Object oriented
Functional
Procedural
Interpreted
Late binding
Dynamic typing
Automatic garbage collection

Comments
#
Every to the right of #

Floor division
/

normal division - always returns a float

17 / 3 = 5.67

// floor division discards the fraction


17 // 3 = 5

Matrix Multiplication
@ operator does true matrix multiplication (not element multiplication)

Strings
Use either single or double quotes
Use \ for controls
doesnt
doesnt
doesn\t

Strings manipulation
good + bye
goodbye
good bye
goodbye
good + 3 * bye
goodbyebyebye

Index
word = Python
word[0]
P
word[-1]
o
Word[2:4]
th

(2 is included, 4 is excluded)(slicing)

Lists (think arrays)


Acts like csv
Supports mixed data
data = [abc, 3, 4.5, xyz]

If
If age > 18:
# do something
elif age > 21:
# do something
elif age > 35:
# do something
else:
# do something

for
for person in employees:
print(person)

Programming Style
PEP 8 official programming style guide for Python

Packages
Package

Use

NumPy

Data manipulation

Pandas (Python Data Analysis Library)

Data analytics

Matplotlib

Data visualization

Scikit-learn

Machine Learning

PyMySQL

SQL database interaction

BeautifulSoup

XML and HTML

Ok, what can I do with Python?


Two types of development
- Traditional application
- Data Science

Games

Applications

Data Science

Dashboards
https://plot.ly/python/dashboard/

Questions
wrightg@husson.edu

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