SlideShare a Scribd company logo
1 of 22
My First Python Project 
Neetu Jain 
Software Engineer 
Softlayer, IBM 
nutshi@gmail.com, njain@softlayer.com
What’s Ahead? 
What to expect when diving into python: 
Bird’s eye view of “getting started into python” 
How to start your first python project: 
some kind of a skeleton , resources, pointers 
Help you realise that some comics hit close to home: 
Thanks to xkcd.com 
*** if you already know python, you might not get much out of this talk :)***
First Stop:Install 
Python Version: 
Python 2.x or Python 3.x 
Python IDE: 
Pycharm, pythonwin, sublime ...e.t.c 
version control: 
git, svn...e.t.c
Readability(whitespace) Matters!
Zen Of Python 
PEP8 
pip install --upgrade pep8 
pep8 --show-source --show-pep8 test.py 
4685 E501 line too long (80 > 79 characters) 
1718 E302 expected 2 blank lines, found 1 
pep8 --statistics -qq Project/ 
Pylint 
pip install pylint 
pylint --reports=n test.py 
C0111: 4,0:sth1: Missing docstring 
W0104: 5,4:sth1: Statement seems to have no effect
No More Compiler Breaks!
Nostalgia!
Bye Bye Static Typing
Built-in Data Structures 
● Sets 
● List 
● Tuple 
● Dictionary
No Pointers->No Segfaults 
*forget memory management and issues that arise from it*
Recycling Wins Reinventing 
Not likely in Python
Power of PyPi 
$pip install newpackage 
$import newpackage 
$newpackage.callitsfunction()
Testing Tools Ensure Automation 
**https://wiki.python.org/moin/PythonTestingToolsTaxonomy**
Tests:made easy 
$python unittest_simple.py 
$ python unittest_simple.py -v 
test (__main__.SimplisticTest) ... ok 
------------------------------------ 
Ran 1 test in 0.000s 
OK/FAIL/ERROR 
unittest_simple.py 
import unittest 
class FixturesTest(unittest.TestCase): 
def test(self): 
print 'in test()' 
self.failIf(True, 'failure message goes here') 
if __name__ == '__main__': 
unittest.main()
Python: you can do a lot! 
Process mgmt: supervisor 
Deployment mgmt :fabric Database: sqllite 
Web framework:flask Messaging: pika(amqp)
Virtual environment 
$ [sudo] pip install virtualenv 
$ cd ~/code/myproject/ 
$ virtualenv env 
New python executable in env/bin/python 
Installing setuptools............done. 
Installing pip...............done. 
$ ls env 
bin include lib 
$ which python 
/usr/bin/python 
$ source env/bin/activate 
$ which python 
/Users/name/code/myproject/env/bin/python
Directory structure some_root_dir/ 
|-- LICENSE 
|-- README 
|-- setup.py 
|-- example_project/ 
| |-- __init__.py 
| |-- useful_1.py 
| |-- drivers/ 
| | |--useful_2.py 
|-- tests/ 
| |-- __init__.py 
| |-- runall.py 
| |-- test0.py 
|-- docs/ 
| |--conf.py 
| |--generated
Setup.py 
from setuptools import setup, find_packages 
setup( 
name='buzz', 
version='0.1', 
description=Project name ', 
long_description=open('README.md', 'r').read(), 
classifiers=[ 
'Development Status :: 1 - Beta', 
'Programming Language :: Python :: 2.7', 
], 
author_email='innovation@softlayer.com', 
url='http://sldn.softlayer.com', 
license='MIT', 
packages=find_packages(), 
include_package_data=True, 
install_requires=[ 
‘package-name’, 
‘docutils>=0.3’, 
], 
entry_points={ 
'console_scripts': [ 
'face_of_project = module:your_function, 
] 
}, 
#just download not install 
setup_requires=[], 
)
vagrant VM manager 
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 
$ mkdir my_vagrant_test 
$ cd my_vagrant_test 
$ vagrant init lucid32 
$ vim Vagrantfile 
$ vagrant up 
$ vagrant ssh 
$ vagrant status 
$ vagrant reload 
$ vagrant destroy
Supervisor: A Process Control System 
vagrant@buzz:~$ supervisord -c /vagrant/scripts/supervisord.conf 
vagrant@buzz:~$ sudo supervisorctl -c /vagrant/scripts/supervisord.conf 
apnsfb RUNNING pid 5671, uptime 0:02:17 
buzz RUNNING pid 5673, uptime 0:02:17 
flask RUNNING pid 5672, uptime 0:02:17 
vagrant@buzz:~$ cat /tmp/supervisord.log 
2014-09-12 18:31:22,001 CRIT Supervisor running as root (no user in config 
file) 
2014-09-12 18:31:22,017 INFO RPC interface 'supervisor' initialized
My First Python Project 
Neetu Jain 
Software Engineer 
Softlayer, IBM 
nutshi@gmail.com, njain@softlayer.com

More Related Content

What's hot

Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1Kanchilug
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabusSugantha T
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Edureka!
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
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 MalothBhavsingh Maloth
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Edureka!
 
1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on pythonSANTOSHJAISWAL52
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Edureka!
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To PythonVanessa Rene
 
Python for the Mobile and Web
Python for the Mobile and WebPython for the Mobile and Web
Python for the Mobile and WebDerek Kiong
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonManishJha237
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingRanel Padon
 
Python tutorial
Python tutorialPython tutorial
Python tutorialGuru99
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 courseHimanshuPanwar38
 

What's hot (19)

Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Python
Python Python
Python
 
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
Python Tutorial For Beginners | Python Crash Course - Python Programming Lang...
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Introduction to python
 Introduction to python Introduction to python
Introduction to python
 
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
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
 
1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python1901200100000 presentation short term mini project on python
1901200100000 presentation short term mini project on python
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Python for the Mobile and Web
Python for the Mobile and WebPython for the Mobile and Web
Python for the Mobile and Web
 
Python
PythonPython
Python
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI Programming
 
Python tutorial
Python tutorialPython tutorial
Python tutorial
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
 

Similar to First python project

Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Henry Schreiner
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingHenry Schreiner
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingHenry Schreiner
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MoreMatt Harrison
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Codemotion
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolutionTatiana Al-Chueyr
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Yuriy Senko
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Patrick Muehlbauer
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in pythonJimmy Lai
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionJuraj Michálek
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Intro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsIntro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsRoger Barnes
 
OpenStack for Centos
OpenStack for CentosOpenStack for Centos
OpenStack for CentosChandan Kumar
 
Writing a Python C extension
Writing a Python C extensionWriting a Python C extension
Writing a Python C extensionSqreen
 

Similar to First python project (20)

Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meeting
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and More
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
 
Python packaging and dependency resolution
Python packaging and dependency resolutionPython packaging and dependency resolution
Python packaging and dependency resolution
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Python on pi
Python on piPython on pi
Python on pi
 
Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018Python Dependency Management - PyconDE 2018
Python Dependency Management - PyconDE 2018
 
Python+gradle
Python+gradlePython+gradle
Python+gradle
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
Startup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django sessionStartup Camp - Git, Python, Django session
Startup Camp - Git, Python, Django session
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Intro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsIntro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django Apps
 
OpenStack for Centos
OpenStack for CentosOpenStack for Centos
OpenStack for Centos
 
Writing a Python C extension
Writing a Python C extensionWriting a Python C extension
Writing a Python C extension
 

Recently uploaded

Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...RegineManuel2
 
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一fjjwgk
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter TerrorismNilendra Kumar
 
定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一z zzz
 
Issues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxIssues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxJenniferPeraro1
 
Ethics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptEthics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptShafqatShakeel1
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证nhjeo1gg
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样umasea
 
tools in IDTelated to first year vtu students is useful where they can refer ...
tools in IDTelated to first year vtu students is useful where they can refer ...tools in IDTelated to first year vtu students is useful where they can refer ...
tools in IDTelated to first year vtu students is useful where they can refer ...vinbld123
 
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量sehgh15heh
 
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxKindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxLesterJayAquino
 
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewNilendra Kumar
 
Digital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Discovery Institute
 
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdf
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdfMost Inspirational Leaders Empowering the Educational Sector, 2024.pdf
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdfTheKnowledgeReview2
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfjtzach
 
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012sapnasaifi408
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveMarharyta Nedzelska
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改yuu sss
 

Recently uploaded (20)

Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
 
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter Terrorism
 
定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一
 
Issues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxIssues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptx
 
Ethics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptEthics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.ppt
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
 
tools in IDTelated to first year vtu students is useful where they can refer ...
tools in IDTelated to first year vtu students is useful where they can refer ...tools in IDTelated to first year vtu students is useful where they can refer ...
tools in IDTelated to first year vtu students is useful where they can refer ...
 
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
原版定制copy澳洲查尔斯达尔文大学毕业证CDU毕业证成绩单留信学历认证保障质量
 
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxKindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
 
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
 
Digital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, India
 
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdf
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdfMost Inspirational Leaders Empowering the Educational Sector, 2024.pdf
Most Inspirational Leaders Empowering the Educational Sector, 2024.pdf
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdf
 
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
 
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental Leave
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
 

First python project

  • 1. My First Python Project Neetu Jain Software Engineer Softlayer, IBM nutshi@gmail.com, njain@softlayer.com
  • 2. What’s Ahead? What to expect when diving into python: Bird’s eye view of “getting started into python” How to start your first python project: some kind of a skeleton , resources, pointers Help you realise that some comics hit close to home: Thanks to xkcd.com *** if you already know python, you might not get much out of this talk :)***
  • 3. First Stop:Install Python Version: Python 2.x or Python 3.x Python IDE: Pycharm, pythonwin, sublime ...e.t.c version control: git, svn...e.t.c
  • 5. Zen Of Python PEP8 pip install --upgrade pep8 pep8 --show-source --show-pep8 test.py 4685 E501 line too long (80 > 79 characters) 1718 E302 expected 2 blank lines, found 1 pep8 --statistics -qq Project/ Pylint pip install pylint pylint --reports=n test.py C0111: 4,0:sth1: Missing docstring W0104: 5,4:sth1: Statement seems to have no effect
  • 8. Bye Bye Static Typing
  • 9. Built-in Data Structures ● Sets ● List ● Tuple ● Dictionary
  • 10. No Pointers->No Segfaults *forget memory management and issues that arise from it*
  • 11. Recycling Wins Reinventing Not likely in Python
  • 12. Power of PyPi $pip install newpackage $import newpackage $newpackage.callitsfunction()
  • 13. Testing Tools Ensure Automation **https://wiki.python.org/moin/PythonTestingToolsTaxonomy**
  • 14. Tests:made easy $python unittest_simple.py $ python unittest_simple.py -v test (__main__.SimplisticTest) ... ok ------------------------------------ Ran 1 test in 0.000s OK/FAIL/ERROR unittest_simple.py import unittest class FixturesTest(unittest.TestCase): def test(self): print 'in test()' self.failIf(True, 'failure message goes here') if __name__ == '__main__': unittest.main()
  • 15. Python: you can do a lot! Process mgmt: supervisor Deployment mgmt :fabric Database: sqllite Web framework:flask Messaging: pika(amqp)
  • 16.
  • 17. Virtual environment $ [sudo] pip install virtualenv $ cd ~/code/myproject/ $ virtualenv env New python executable in env/bin/python Installing setuptools............done. Installing pip...............done. $ ls env bin include lib $ which python /usr/bin/python $ source env/bin/activate $ which python /Users/name/code/myproject/env/bin/python
  • 18. Directory structure some_root_dir/ |-- LICENSE |-- README |-- setup.py |-- example_project/ | |-- __init__.py | |-- useful_1.py | |-- drivers/ | | |--useful_2.py |-- tests/ | |-- __init__.py | |-- runall.py | |-- test0.py |-- docs/ | |--conf.py | |--generated
  • 19. Setup.py from setuptools import setup, find_packages setup( name='buzz', version='0.1', description=Project name ', long_description=open('README.md', 'r').read(), classifiers=[ 'Development Status :: 1 - Beta', 'Programming Language :: Python :: 2.7', ], author_email='innovation@softlayer.com', url='http://sldn.softlayer.com', license='MIT', packages=find_packages(), include_package_data=True, install_requires=[ ‘package-name’, ‘docutils>=0.3’, ], entry_points={ 'console_scripts': [ 'face_of_project = module:your_function, ] }, #just download not install setup_requires=[], )
  • 20. vagrant VM manager $ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box $ mkdir my_vagrant_test $ cd my_vagrant_test $ vagrant init lucid32 $ vim Vagrantfile $ vagrant up $ vagrant ssh $ vagrant status $ vagrant reload $ vagrant destroy
  • 21. Supervisor: A Process Control System vagrant@buzz:~$ supervisord -c /vagrant/scripts/supervisord.conf vagrant@buzz:~$ sudo supervisorctl -c /vagrant/scripts/supervisord.conf apnsfb RUNNING pid 5671, uptime 0:02:17 buzz RUNNING pid 5673, uptime 0:02:17 flask RUNNING pid 5672, uptime 0:02:17 vagrant@buzz:~$ cat /tmp/supervisord.log 2014-09-12 18:31:22,001 CRIT Supervisor running as root (no user in config file) 2014-09-12 18:31:22,017 INFO RPC interface 'supervisor' initialized
  • 22. My First Python Project Neetu Jain Software Engineer Softlayer, IBM nutshi@gmail.com, njain@softlayer.com

Editor's Notes

  1. Vagrant, an open-source product released in 2010, is best described as a VM manager. It allows you to script and package the VM config and the provisioning setup. It is designed to run on top of almost any VM tool – VirtualBox, VMWare, AWS, etc.