SlideShare a Scribd company logo
Introduction to Python 3
“Your first scripting in Python 3.x” workshop
Youhei Sakurai, TC, CSS, YSJ
EU-US time zone, 31 October, 2016
Youhei Sakurai
• Intermediate Pythonista
• Started to learn Python in 2010.
• Have been introducing Python several times since 2011.
• Publishing one package on PyPI – PyMemoryModule.
• My name is written in change log of lxml 3.6.0. 
Rules
• Will finish on time even if some of topics are not completed.
• Turn on your web-cam to enhance your active involvement.
• Raise your questions to drive bi-directional communication.
• If it is beyond beginner’s level, I’d suggest to have separate call.
• If there’re too many, I’d select rather important ones for everyone.
• Stay sharp with your text editor and Python installer.
Agenda
• What’s Python
• How Python looks like
• Let’s set up Python
• “Hello world!”
• Do basic practices
• Your first scripting
• Study materials
• Kahoot quiz
Goals
• Make Python ready on your workstation.
• Make yourself ready in the Python 3.x Ocean.
• Get breadcrumb list to learn Python 3.x.
• And... Let you get high score at Kahoot quiz. 
What’s Python
Make Python ready
Make yourself ready
Get breadcrumb list
Python is,,,
• Programing language like Java, C, Perl, Ruby, etc
• Easy to run because of cross platform scripting language
• Clear look & feel thanks to language design and culture hating magics
• Able do anything (multi-purpose glue language) except writing OS/drivers
• Used everywhere e.g. in Amazon, Google, Yahoo, Dropbox, NASA, etc
Most attractive features
• Batteries included
• Web server, database, GUI, networking, regex, XML, JSON, archiving, C/C++
integration, thread/process pooling, async I/O, serialization, etc.
• More batteries invented
• Intelligences are innovating technologies all over the world day by day.
• You can try the innovations using pip through the Internet.
• Easier than English
• Even I can write Python codes better than English email. 
• All you need is not LOVE but intelligence with a little knowledge about Python.
My favorites
• Python runs everywhere
• Python allows me to explain things very clearly
A few disadvantages
• Slower than C/C++ and assembly
• No JIT (Just-In-Time) compiler equipped in CPython
• Jython and IronPython falls much behind CPython
• Weaker multithreading due to GIL in CPython
Who cares?
So Python could be also,,,
Something special making your professional life much more
brilliant never ever before!!
A bit more about Python
History of Python
• Created in 1989 by Guido Van Rossum
• Python 2.7 released in 2010
• Python 3.5 released in 2015
PEP 404 - No 2.8 planned
PEP 373 - EOL of 2.7 planed in 2020
Zen of Python (by Tim Peters)
• Beautiful is better than ugly.
• Explicit is better than implicit.
• Simple is better than complex.
…
What’s Python
How Python looks like
Make Python ready
Make yourself ready
Get breadcrumb list
How Python looks like
Interactive shell
• Just run `python` or `python3`
Script
1. Create e.g. `script.py` file
2. Save it as UTF-8 text file
3. Run `python script.py`
Version info
Type any codes
Differentiations from C style code
1. `:` + 4x space instead of `{ … }`
2. Pascal-like operators -> `and` `or` `not`
3. Bash-like comment -> starting with `#`
4. No difference between `’` and `”`
5. No need to put `;` at the end of line
sample.py sample.c
What’s Python
How Python looks like
Let’s set up Python
Make Python ready
Make yourself ready
Get breadcrumb list
Let’s set up Python
Windows / Mac OS X
1. Download installer
2. Double-click installer
Windows
-> Add Python to PATH
Mac OS X
-> Do NEVER fix system Python
3. Complete installation
Linux (Debian/Ubuntu)
1. Retrieve packages list
apt-get update
2. Install Python 3.x
apt-get install python3
3. Install pip
apt-get install python3-pip
Where to install?
`C:¥Python35` and `C:¥Python35-x64` IMHO
Let’s install ipython using pip
1. Ensure connectivity to the Internet
2. Type `pip install ipython`
3. Hit [Enter]
…
pip and ipython
•pip … Package manager in Python
• Packages are on public repository similarly with apt, ppm, npm, etc
•ipython … Enhanced interactive shell
• [TAB] -> completion
• `?` -> show help
• `??` -> show source
• `_` -> refer last output
• Auto indentation, [Ctrl]+c capturing, search ([Ctrl]+r), etc
What’s Python
How Python looks like
Let’s set up Python
“Hello world!”
✓Make Python ready
Make yourself ready
Get breadcrumb list
“Hello world!”
1. Run `python` or `ipython`
2. Type `print(“Hello world!”)`
3. Hit [Enter]
How Python looks like
Let’s set up Python
“Hello world!”
Do basic practices
✓Make Python ready
Make yourself ready
Get breadcrumb list
Differentiations from C style code
1. `:` + indentation instead of `{ … }`
2. Pascal-like operators -> `and` `or` `not`
3. Bash-like comment -> starting with `#`
4. No difference between `’` and `”`
5. No need to put `;` at the end of line
sample.py sample.c
Do basic practices – if … elif … else
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Do basic practices – list, len(…)
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Do basic practices – for … in …, range(…)
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Do basic practices – while …, import
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Do basic practices – open, “…”, b”…”
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
str object v.s. bytes object
str – String
"text"
bytes – Binary data
b"¥x74¥x65¥x78¥x74"
(= b"text")
"text".encode()
b"text".decode()
Do basic practices – open, “…”, b”…”
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Do basic practices – urlopen
1. Run `ipython`
2. Type code(s)
3. Hit [Enter]
Let’s set up Python
“Hello world!”
Do basic practices
Your first scripting
✓Make Python ready
✓Make yourself ready
Get breadcrumb list
Your first scripting
• I am going to write dummy Web server.
• My script will do:
• Listen on 80/tcp.
• Accept incoming connections.
• Respond random number of words.
• You are going to write HTTP client.
• Your script will do:
• Access server via HTTP.
• Read content from response object. <- How to decode binary data?
• Split content by white space. <- How to split string?
• Print how many words in response. <- How to count list of strings?
“Hello world!”
Do basic practices
Your first scripting
Study materials
✓Make Python ready
✓Make yourself ready
Get breadcrumb list
Study materials
•The Python Tutorial
• Describes all you need to know about Python
•Learn Python the Hard Way
• Gives practical tasks to make you able to write Python codes
•GitHub
• Guides how you should write well-mannered Python codes
Congratulations!! 
✓Make Python ready
✓Make yourself ready
✓Get breadcrumb list
Thank you for your participation.
Open Kahoot! - https://kahoot.it
Ad

More Related Content

What's hot (20)

Get started python programming part 1
Get started python programming   part 1Get started python programming   part 1
Get started python programming part 1
Nicholas I
 
Python 101
Python 101Python 101
Python 101
Ahmet SEĞMEN
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
Edureka!
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
R.h. Himel
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
St. Petersburg College
 
Python ppt
Python pptPython ppt
Python ppt
Mohita Pandey
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
Haitham El-Ghareeb
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
Collaboration Technologies
 
Beginning Python
Beginning PythonBeginning Python
Beginning Python
Ankur Shrivastava
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
Porimol Chandro
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
MaheshPandit16
 
web programming Unit VIII complete about python by Bhavsingh Maloth
web programming Unit VIII complete about python  by Bhavsingh Malothweb programming Unit VIII complete about python  by Bhavsingh Maloth
web programming Unit VIII complete about python by Bhavsingh Maloth
Bhavsingh Maloth
 
Introduction Jupyter Notebook
Introduction Jupyter NotebookIntroduction Jupyter Notebook
Introduction Jupyter Notebook
thirumurugan133
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
JanBask Training
 
Python by Rj
Python by RjPython by Rj
Python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Yi-Fan Chu
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
Vijay Chaitanya
 
Getting started with Linux and Python by Caffe
Getting started with Linux and Python by CaffeGetting started with Linux and Python by Caffe
Getting started with Linux and Python by Caffe
Lihang Li
 
Get started python programming part 1
Get started python programming   part 1Get started python programming   part 1
Get started python programming part 1
Nicholas I
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
Edureka!
 
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
R.h. Himel
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Introduction to programming with python
Introduction to programming with pythonIntroduction to programming with python
Introduction to programming with python
Porimol Chandro
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
MaheshPandit16
 
web programming Unit VIII complete about python by Bhavsingh Maloth
web programming Unit VIII complete about python  by Bhavsingh Malothweb programming Unit VIII complete about python  by Bhavsingh Maloth
web programming Unit VIII complete about python by Bhavsingh Maloth
Bhavsingh Maloth
 
Introduction Jupyter Notebook
Introduction Jupyter NotebookIntroduction Jupyter Notebook
Introduction Jupyter Notebook
thirumurugan133
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
JanBask Training
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Yi-Fan Chu
 
Getting started with Linux and Python by Caffe
Getting started with Linux and Python by CaffeGetting started with Linux and Python by Caffe
Getting started with Linux and Python by Caffe
Lihang Li
 

Viewers also liked (20)

Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
Matt Harrison
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
Asynchronous I/O in Python 3
Asynchronous I/O in Python 3Asynchronous I/O in Python 3
Asynchronous I/O in Python 3
Feihong Hsu
 
Introduction to Graphics
Introduction to GraphicsIntroduction to Graphics
Introduction to Graphics
primeteacher32
 
OSCON 2008: Porting to Python 3.0
OSCON 2008: Porting to Python 3.0OSCON 2008: Porting to Python 3.0
OSCON 2008: Porting to Python 3.0
guest4d09
 
Cc code cards
Cc code cardsCc code cards
Cc code cards
ysolanki78
 
Apache Web Server Setup 3
Apache Web Server Setup 3Apache Web Server Setup 3
Apache Web Server Setup 3
Information Technology
 
Python 3000
Python 3000Python 3000
Python 3000
Bob Chao
 
Python programming lab2
Python programming lab2Python programming lab2
Python programming lab2
profbnk
 
Python programming lab1
Python programming lab1Python programming lab1
Python programming lab1
profbnk
 
Securing Apache Web Servers
Securing Apache Web ServersSecuring Apache Web Servers
Securing Apache Web Servers
Information Technology
 
PyTrening 2.0 # 15 Okienka GUI
PyTrening 2.0 # 15 Okienka GUIPyTrening 2.0 # 15 Okienka GUI
PyTrening 2.0 # 15 Okienka GUI
MoniaJ
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming Language
YLTO
 
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and IndentationPython Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and Indentation
P3 InfoTech Solutions Pvt. Ltd.
 
PythonIntro
PythonIntroPythonIntro
PythonIntro
webuploader
 
Python Tutorial
Python TutorialPython Tutorial
Python Tutorial
AkramWaseem
 
Python - basics
Python - basicsPython - basics
Python - basics
Jéferson Machado
 
AmI 2015 - Python basics
AmI 2015 - Python basicsAmI 2015 - Python basics
AmI 2015 - Python basics
Luigi De Russis
 
Python and you
Python and youPython and you
Python and you
Sian Lerk Lau
 
Python Basics
Python BasicsPython Basics
Python Basics
tusharpanda88
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
Matt Harrison
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
Paige Bailey
 
Asynchronous I/O in Python 3
Asynchronous I/O in Python 3Asynchronous I/O in Python 3
Asynchronous I/O in Python 3
Feihong Hsu
 
Introduction to Graphics
Introduction to GraphicsIntroduction to Graphics
Introduction to Graphics
primeteacher32
 
OSCON 2008: Porting to Python 3.0
OSCON 2008: Porting to Python 3.0OSCON 2008: Porting to Python 3.0
OSCON 2008: Porting to Python 3.0
guest4d09
 
Python 3000
Python 3000Python 3000
Python 3000
Bob Chao
 
Python programming lab2
Python programming lab2Python programming lab2
Python programming lab2
profbnk
 
Python programming lab1
Python programming lab1Python programming lab1
Python programming lab1
profbnk
 
PyTrening 2.0 # 15 Okienka GUI
PyTrening 2.0 # 15 Okienka GUIPyTrening 2.0 # 15 Okienka GUI
PyTrening 2.0 # 15 Okienka GUI
MoniaJ
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming Language
YLTO
 
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and IndentationPython Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and Indentation
P3 InfoTech Solutions Pvt. Ltd.
 
AmI 2015 - Python basics
AmI 2015 - Python basicsAmI 2015 - Python basics
AmI 2015 - Python basics
Luigi De Russis
 
Ad

Similar to Introduction to python 3 2nd round (20)

05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
SugumarSarDurai
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
Punithavel Ramani
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
Justin Lin
 
chapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptxchapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptx
aniruddhmishra2007
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
gmadhu8
 
chapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptxchapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptx
Jahnavi113937
 
Python
PythonPython
Python
Shivam Gupta
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
Shivam Gupta
 
Rustifying a Python package in 2025 with pyo3 and maturin
Rustifying a Python package in 2025 with pyo3 and maturinRustifying a Python package in 2025 with pyo3 and maturin
Rustifying a Python package in 2025 with pyo3 and maturin
ArthurAndres2
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
Welcome_to_Python.pptx
Welcome_to_Python.pptxWelcome_to_Python.pptx
Welcome_to_Python.pptx
21M220KARTHIKEYANC
 
python program
python programpython program
python program
tomlee12821
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptx
adityakumawat625
 
1B-Introduction_to_python.ppt
1B-Introduction_to_python.ppt1B-Introduction_to_python.ppt
1B-Introduction_to_python.ppt
AmritMarwaha1
 
Doing the Impossible
Doing the ImpossibleDoing the Impossible
Doing the Impossible
Alexander Loechel
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
Justin Lin
 
chapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptxchapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptx
aniruddhmishra2007
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
Eran Shlomo
 
python-160403194316.pdf
python-160403194316.pdfpython-160403194316.pdf
python-160403194316.pdf
gmadhu8
 
chapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptxchapter-1-eng-getting-started-with-python.pptx
chapter-1-eng-getting-started-with-python.pptx
Jahnavi113937
 
Python Seminar PPT
Python Seminar PPTPython Seminar PPT
Python Seminar PPT
Shivam Gupta
 
Rustifying a Python package in 2025 with pyo3 and maturin
Rustifying a Python package in 2025 with pyo3 and maturinRustifying a Python package in 2025 with pyo3 and maturin
Rustifying a Python package in 2025 with pyo3 and maturin
ArthurAndres2
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
python intro and installation.pptx
python intro and installation.pptxpython intro and installation.pptx
python intro and installation.pptx
adityakumawat625
 
1B-Introduction_to_python.ppt
1B-Introduction_to_python.ppt1B-Introduction_to_python.ppt
1B-Introduction_to_python.ppt
AmritMarwaha1
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
Ad

Recently uploaded (20)

AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptxSmart Investments Leveraging Agentic AI for Real Estate Success.pptx
Smart Investments Leveraging Agentic AI for Real Estate Success.pptx
Seasia Infotech
 
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of ExchangesJignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah - The Innovator and Czar of Exchanges
Jignesh Shah Innovator
 
UiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer OpportunitiesUiPath Agentic Automation: Community Developer Opportunities
UiPath Agentic Automation: Community Developer Opportunities
DianaGray10
 
Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...Transcript: Canadian book publishing: Insights from the latest salary survey ...
Transcript: Canadian book publishing: Insights from the latest salary survey ...
BookNet Canada
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptxWebinar - Top 5 Backup Mistakes MSPs and Businesses Make   .pptx
Webinar - Top 5 Backup Mistakes MSPs and Businesses Make .pptx
MSP360
 
Bepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firmBepents tech services - a premier cybersecurity consulting firm
Bepents tech services - a premier cybersecurity consulting firm
Benard76
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and MLGyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
GyrusAI - Broadcasting & Streaming Applications Driven by AI and ML
Gyrus AI
 

Introduction to python 3 2nd round

  • 1. Introduction to Python 3 “Your first scripting in Python 3.x” workshop Youhei Sakurai, TC, CSS, YSJ EU-US time zone, 31 October, 2016
  • 2. Youhei Sakurai • Intermediate Pythonista • Started to learn Python in 2010. • Have been introducing Python several times since 2011. • Publishing one package on PyPI – PyMemoryModule. • My name is written in change log of lxml 3.6.0. 
  • 3. Rules • Will finish on time even if some of topics are not completed. • Turn on your web-cam to enhance your active involvement. • Raise your questions to drive bi-directional communication. • If it is beyond beginner’s level, I’d suggest to have separate call. • If there’re too many, I’d select rather important ones for everyone. • Stay sharp with your text editor and Python installer.
  • 4. Agenda • What’s Python • How Python looks like • Let’s set up Python • “Hello world!” • Do basic practices • Your first scripting • Study materials • Kahoot quiz
  • 5. Goals • Make Python ready on your workstation. • Make yourself ready in the Python 3.x Ocean. • Get breadcrumb list to learn Python 3.x. • And... Let you get high score at Kahoot quiz. 
  • 6. What’s Python Make Python ready Make yourself ready Get breadcrumb list
  • 7. Python is,,, • Programing language like Java, C, Perl, Ruby, etc • Easy to run because of cross platform scripting language • Clear look & feel thanks to language design and culture hating magics • Able do anything (multi-purpose glue language) except writing OS/drivers • Used everywhere e.g. in Amazon, Google, Yahoo, Dropbox, NASA, etc
  • 8. Most attractive features • Batteries included • Web server, database, GUI, networking, regex, XML, JSON, archiving, C/C++ integration, thread/process pooling, async I/O, serialization, etc. • More batteries invented • Intelligences are innovating technologies all over the world day by day. • You can try the innovations using pip through the Internet. • Easier than English • Even I can write Python codes better than English email.  • All you need is not LOVE but intelligence with a little knowledge about Python.
  • 9. My favorites • Python runs everywhere • Python allows me to explain things very clearly
  • 10. A few disadvantages • Slower than C/C++ and assembly • No JIT (Just-In-Time) compiler equipped in CPython • Jython and IronPython falls much behind CPython • Weaker multithreading due to GIL in CPython Who cares?
  • 11. So Python could be also,,, Something special making your professional life much more brilliant never ever before!!
  • 12. A bit more about Python History of Python • Created in 1989 by Guido Van Rossum • Python 2.7 released in 2010 • Python 3.5 released in 2015 PEP 404 - No 2.8 planned PEP 373 - EOL of 2.7 planed in 2020 Zen of Python (by Tim Peters) • Beautiful is better than ugly. • Explicit is better than implicit. • Simple is better than complex. …
  • 13. What’s Python How Python looks like Make Python ready Make yourself ready Get breadcrumb list
  • 14. How Python looks like Interactive shell • Just run `python` or `python3` Script 1. Create e.g. `script.py` file 2. Save it as UTF-8 text file 3. Run `python script.py` Version info Type any codes
  • 15. Differentiations from C style code 1. `:` + 4x space instead of `{ … }` 2. Pascal-like operators -> `and` `or` `not` 3. Bash-like comment -> starting with `#` 4. No difference between `’` and `”` 5. No need to put `;` at the end of line sample.py sample.c
  • 16. What’s Python How Python looks like Let’s set up Python Make Python ready Make yourself ready Get breadcrumb list
  • 17. Let’s set up Python Windows / Mac OS X 1. Download installer 2. Double-click installer Windows -> Add Python to PATH Mac OS X -> Do NEVER fix system Python 3. Complete installation Linux (Debian/Ubuntu) 1. Retrieve packages list apt-get update 2. Install Python 3.x apt-get install python3 3. Install pip apt-get install python3-pip
  • 18. Where to install? `C:¥Python35` and `C:¥Python35-x64` IMHO
  • 19. Let’s install ipython using pip 1. Ensure connectivity to the Internet 2. Type `pip install ipython` 3. Hit [Enter] …
  • 20. pip and ipython •pip … Package manager in Python • Packages are on public repository similarly with apt, ppm, npm, etc •ipython … Enhanced interactive shell • [TAB] -> completion • `?` -> show help • `??` -> show source • `_` -> refer last output • Auto indentation, [Ctrl]+c capturing, search ([Ctrl]+r), etc
  • 21. What’s Python How Python looks like Let’s set up Python “Hello world!” ✓Make Python ready Make yourself ready Get breadcrumb list
  • 22. “Hello world!” 1. Run `python` or `ipython` 2. Type `print(“Hello world!”)` 3. Hit [Enter]
  • 23. How Python looks like Let’s set up Python “Hello world!” Do basic practices ✓Make Python ready Make yourself ready Get breadcrumb list
  • 24. Differentiations from C style code 1. `:` + indentation instead of `{ … }` 2. Pascal-like operators -> `and` `or` `not` 3. Bash-like comment -> starting with `#` 4. No difference between `’` and `”` 5. No need to put `;` at the end of line sample.py sample.c
  • 25. Do basic practices – if … elif … else 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 26. Do basic practices – list, len(…) 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 27. Do basic practices – for … in …, range(…) 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 28. Do basic practices – while …, import 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 29. Do basic practices – open, “…”, b”…” 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 30. str object v.s. bytes object str – String "text" bytes – Binary data b"¥x74¥x65¥x78¥x74" (= b"text") "text".encode() b"text".decode()
  • 31. Do basic practices – open, “…”, b”…” 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 32. Do basic practices – urlopen 1. Run `ipython` 2. Type code(s) 3. Hit [Enter]
  • 33. Let’s set up Python “Hello world!” Do basic practices Your first scripting ✓Make Python ready ✓Make yourself ready Get breadcrumb list
  • 34. Your first scripting • I am going to write dummy Web server. • My script will do: • Listen on 80/tcp. • Accept incoming connections. • Respond random number of words. • You are going to write HTTP client. • Your script will do: • Access server via HTTP. • Read content from response object. <- How to decode binary data? • Split content by white space. <- How to split string? • Print how many words in response. <- How to count list of strings?
  • 35. “Hello world!” Do basic practices Your first scripting Study materials ✓Make Python ready ✓Make yourself ready Get breadcrumb list
  • 36. Study materials •The Python Tutorial • Describes all you need to know about Python •Learn Python the Hard Way • Gives practical tasks to make you able to write Python codes •GitHub • Guides how you should write well-mannered Python codes
  • 37. Congratulations!!  ✓Make Python ready ✓Make yourself ready ✓Get breadcrumb list
  • 38. Thank you for your participation. Open Kahoot! - https://kahoot.it
  翻译: