Download Tutorial Slides

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Tutorial 1
AWS and Python
Kai CHEN
Introduction to AWS
• Amazon Web Service
• Best-known cloud service provider
• Offersasuiteof cloud-computing services
• ElasticComputeCloud (EC2)
• AWSFreeTier
• Amazon EC2 instance: 750hours permonth
(12 month)
• Amazon S3...
• AWS Educate
• Free credits (USD $35)
Account Registration
• https://www.awseducate.com/Application
• Detailedsteps(lastyear):
https://course.ie.cuhk.edu.hk/~ierg4080/tutorials/
Tutorial%201.html
• Officialguide:
http://docs.aws.amazon.com/AWSEC2/latest/User
Guide/get-set-up-for-amazon-ec2.html
Setup
• Environmentsetting
– IAMuser
– keypair
– securitygroup
• VMcreating
• http://docs.aws.amazon.com/AWSEC2/latest/Us
erGuide/EC2_GetStarted.html
Basic Linux Administration
• SSH connection
• Typical servers
• Amazon EC2
Basic Linux Administration
• File system
• All are files
• List directory
• Change directory
• Copy files
• Move/Rename files
• Delete files
• Create files
Basic Linux Administration
• Execute files
Basic Linux Administration
• Get help
• cmd --help
• man cmd
Python (part I)
What can Python do
Tasks
General
Academic
Libraries
Text processing
Standard libraries
Web service
Flask, django, …
Web crawler
requests, BeautifulSoup,
Scrapy, ...
GUI
Tkinter, wxWidgets, PyQt, …
Scientific computation
numpy, scipy, matplotlib, …
Image processing
Pillow, OpenCV, …
Natural language processing
NLTK, spaCy, CoreNLP, …
Machine learning
Theano, scikit-learn, …
Python (part I)
• Easy to get started
• Rich libraries
• Productive
• Speed
Python (part I)
Interactiveshell
Python (part I)
Python script
test.py
Encoding statement
Import modules/packages
Function definition
A little complex
top-level script
Function call
Python (part I)
Built-in types – numeric types
int, long, float, complex
Different behavior in Python 2/3
+, -, *, /, //, %, **, bitwise operations
Python (part I)
Built-in types – sequence types
str
list
immutable vs mutable
tuple
Python (part I)
Built-in types – mapping types
dict
Python (part I)
Built-in types – others
•
•
•
•
Set
Ordereddict
defaultdict
…
Python (part I)
Control flow
If statement
Conditional operator?
switch-case?
Python (part I)
Control flow
Iterate over a list
Iterate over a dict
Iterate over a range
Python (part I)
Function
Function name
Required arguments
Default value
Return value
Python (part I)
Class
Python (part I)
Module/Package and imports
Project folder
Package
Package
Module
Module
Python (part I)
Code style
https://www.python.org/dev/peps/pep-0008/
Python 2/3
• https://wiki.python.org/moin/Python2orPython3
• http://pythonhosted.org/six/
Virtual environment
• https://virtualenv.pypa.io/en/stable/
• https://docs.python.org/3/library/venv.html
Thank you!
Related documents