Your SlideShare is downloading. ×
0
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Charming python
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Charming python

2,873

Published on

Published in: Technology
6 Comments
7 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,873
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
52
Comments
6
Likes
7
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Charming Python An introductory session on the Python programming language!
    • 2. Python: A quick look!Python is a programming language that lets you work morequickly and integrate your systems more effectively. You canlearn to use Python and see almost immediate gains inproductivity and lower maintenance costs. General Purpose High Level Interpreted Multi paradigm programming Fully dynamic typing Cross Platform CPython, Jython, IronPython (CPython != Cython)
    • 3. Who uses Python? Google, NASA, Facebook , Yahoo!, Microsoft, Oracle,Nokia, Reddit, Canonical, Walt Disney, Astra Zeneca, Lucasfilm All the cool kids are using Python!
    • 4. Enough Talks! Installing and running python codes*nix and *nix alike system users - sit back and relax!Windows Users:✤ Go to Python.org✤ Get the Python 2 installer✤ Install it yourself✤ Add python to your system path
    • 5. Show me the codes!Let’s say hello to the big snake!print "hello python!"How about a function?def say_hello(name): print "Hello " + name + "!"say_hello("python")
    • 6. Let there be Objects!class TheGreeter:! def __init__(self, name):! ! self.name = name! def greet(self):! ! print "Hello " + self.name + "!"greeter = TheGreeter("Python")greeter.greet()
    • 7. Python Comments!"""class TheGreeter:! def __init__(self, name):! ! self.name = name! def greet(self):! ! print "Hello " + self.name + "!""""greeter = TheGreeter("Python")#greeter.__init__("masnun")greeter.greet()
    • 8. Lists!id_list = [1,2,3,4,5,6,7,8,9,10]# Indexingprint id_list[1]# Add to listid_list.append(11)print id_list# Remove from listid_list.remove(11)print id_list# Slicingnew_list = id_list[0:2]print new_list# List Comprehensionanother_list = [x for x in id_list if x > 5]print another_list# All those squares!print [x**2 for x in id_list]
    • 9. Introspection at it’s best! using dir(), help() and pydoc
    • 10. Conditions and For LoopIn the case of the unforgivable curses!spell_list= ["Crucio!", "Avada Kedavra!","Imperio!","Expelliarmus!"]for spell in spell_list: if spell == "Avada Kedavra!": ! print "Youre dead already!" elif spell == "Imperio!": ! print "You lost control of your mind!" elif spell == "Crucio!": ! print "I can feel your agony!" else: ! print "No unforgivable curses were cast upon you!"
    • 11. While Loopwhile True:! print "Youre in an infinite loop!"
    • 12. Using Modulesimport mathprint math.factorial(999)
    • 13. Writing Modules lib.py def say_hello(): ! print "Hello Python!" greet.py import lib lib.say_hello()And yes, pydoc works on custom modules!
    • 14. The Python Arsenal!Notable frameworks, modules and tools!❖ Django❖ wxWidgets❖ PyQT / PySide❖ Numpy❖ Celery❖ Google App Engine❖ BeautifulSoup❖ Shovel❖ Python for Android❖ Kivy
    • 15. The Zen of Python import this
    • 16. import antigravity
    • 17. PyCharmers & Me! PyCharmers: http://pycharmers.net . Previously known as “Python Bangladesh”, a platform for Bangladeshi Python developers to share and collaborate!Abu Ashraf Masnunhttp://masnun.me | masnun@pycharmers.net | @masnunBusiness student, software gardener and open sourceenthusiast!
    • 18. Slides & CodesSlides: http://www.masnun.me/talksCodes: https://github.com/masnun/openday-khulna
    • 19. Queries?

    ×