Python classes in mumbai
best Python classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
A tour of Python: slides from presentation given in 2012.
[Some slides are not properly rendered in SlideShare: the original is still available at http://www.aleksa.org/2015/04/python-presentation_7.html.]
Deep learning continues to push the state of the art in domains such as computer vision, natural language understanding and recommendation engines. One of the key reasons for this progress is the availability of highly flexible and developer friendly deep learning frameworks. During this workshop, members of the Amazon Machine Learning team will provide a short background on Deep Learning focusing on relevant application domains and an introduction to using the powerful and scalable Deep Learning framework, MXNet. At the end of this tutorial you’ll gain hands on experience targeting a variety of applications including computer vision and recommendation engines as well as exposure to how to use preconfigured Deep Learning AMIs and CloudFormation Templates to help speed your development.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
Monads, also known as Kleisli triples in Category Theory, are an (endo-)functor together with two natural transformations, which are surprisingly useful in pure languages like Haskell, but this talk will NOT reference monads. Ever. (Well, at least not in this talk.)
Instead what I intend to impress upon an audience of newcomers to Haskell is the wide array of freely available libraries most of which are liberally licensed open source software, intuitive package management, practical build tools, reasonable documentation (when you know how to read it and where to find it), interactive shell (or REPL), mature compiler, stable runtime, testing tools that will blow your mind away, and a small but collaborative and knowledgeable community of developers. Oh, and some special features of Haskell - the language - too!
Clojure is a new language that combines the power of Lisp with an existing hosted VM ecosystem (the Java VM). Clojure is a dynamically typed, functional, compiled language with performance on par with Java.
At the heart of all programming lies the need for abstraction, be it abstraction over our data or abstraction over the processes that operate upon it. Clojure provides a core set of powerful abstractions and ways to compose them. These abstractions are based in a heritage of Lisp but also cover many aspects of object-oriented programming as well.
This talk will examine these abstractions and introduce you to both Clojure and functional programming. Attendees are not expected to be familiar with either Clojure or FP.
A tour of Python: slides from presentation given in 2012.
[Some slides are not properly rendered in SlideShare: the original is still available at http://www.aleksa.org/2015/04/python-presentation_7.html.]
Deep learning continues to push the state of the art in domains such as computer vision, natural language understanding and recommendation engines. One of the key reasons for this progress is the availability of highly flexible and developer friendly deep learning frameworks. During this workshop, members of the Amazon Machine Learning team will provide a short background on Deep Learning focusing on relevant application domains and an introduction to using the powerful and scalable Deep Learning framework, MXNet. At the end of this tutorial you’ll gain hands on experience targeting a variety of applications including computer vision and recommendation engines as well as exposure to how to use preconfigured Deep Learning AMIs and CloudFormation Templates to help speed your development.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
Monads, also known as Kleisli triples in Category Theory, are an (endo-)functor together with two natural transformations, which are surprisingly useful in pure languages like Haskell, but this talk will NOT reference monads. Ever. (Well, at least not in this talk.)
Instead what I intend to impress upon an audience of newcomers to Haskell is the wide array of freely available libraries most of which are liberally licensed open source software, intuitive package management, practical build tools, reasonable documentation (when you know how to read it and where to find it), interactive shell (or REPL), mature compiler, stable runtime, testing tools that will blow your mind away, and a small but collaborative and knowledgeable community of developers. Oh, and some special features of Haskell - the language - too!
Clojure is a new language that combines the power of Lisp with an existing hosted VM ecosystem (the Java VM). Clojure is a dynamically typed, functional, compiled language with performance on par with Java.
At the heart of all programming lies the need for abstraction, be it abstraction over our data or abstraction over the processes that operate upon it. Clojure provides a core set of powerful abstractions and ways to compose them. These abstractions are based in a heritage of Lisp but also cover many aspects of object-oriented programming as well.
This talk will examine these abstractions and introduce you to both Clojure and functional programming. Attendees are not expected to be familiar with either Clojure or FP.
A short talk on what makes Functional Programming - and especially Haskell - different.
We'll take a quick overview of Haskell's features and coding style, and then work through a short but complete example of using it for a Real World problem.
http://lanyrd.com/2011/geekup-liverpool-may/sdykh/
Euro python2011 High Performance PythonIan Ozsvald
I ran this as a 4 hour tutorial at EuroPython 2011 to teach High Performance Python coding.
Techniques covered include bottleneck analysis by profiling, bytecode analysis, converting to C using Cython and ShedSkin, use of the numerical numpy library and numexpr, multi-core and multi-machine parallelisation and using CUDA GPUs.
Write-up with 49 page PDF report: http://ianozsvald.com/2011/06/29/high-performance-python-tutorial-v0-1-from-my-4-hour-tutorial-at-europython-2011/
Short (45 min) version of my 'Pragmatic Real-World Scala' talk. Discussing patterns and idioms discovered during 1.5 years of building a production system for finance; portfolio management and simulation.
Odessapy2013 - Graph databases and PythonMax Klymyshyn
Page 10 "Я из Одессы я просто бухаю." translation: I'm from Odessa I just drink. Meaning his drinking a lot of "Vodka" ^_^ (@tuc @hackernews)
This is local meme - when someone asking question and you will look stupid in case you don't have answer.
Alex Smola at AI Frontiers: Scalable Deep Learning Using MXNetAI Frontiers
In this talk at AI Frontiers Conference, Alex Smola gives a brief overview over the features used to scale deep learning using MXNet. It relies on a mix between declarative and imperative programming to achieve efficiency while also allowing for significant flexibility for the user. It relies on a distributed (key, value) store for synchronization between GPUs and between machines. It also relies on the separation between a highly efficient execution engine and language bindings to achieve a high degree of flexibility between different languages while offering a native feel in each of them. Alex also briefly discusses how Amazon AWS can help deploy deep learning models and outline steps on our future roadmap.
Scala is becoming the language of choice for many development teams. This talk highlights how Scala excels in the world of multi-core processing and explores how it compares to Java 8.
Video Presentation: http://youtu.be/8vxTowBXJSg
Robotics classes in mumbai
best Robotics classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
A short talk on what makes Functional Programming - and especially Haskell - different.
We'll take a quick overview of Haskell's features and coding style, and then work through a short but complete example of using it for a Real World problem.
http://lanyrd.com/2011/geekup-liverpool-may/sdykh/
Euro python2011 High Performance PythonIan Ozsvald
I ran this as a 4 hour tutorial at EuroPython 2011 to teach High Performance Python coding.
Techniques covered include bottleneck analysis by profiling, bytecode analysis, converting to C using Cython and ShedSkin, use of the numerical numpy library and numexpr, multi-core and multi-machine parallelisation and using CUDA GPUs.
Write-up with 49 page PDF report: http://ianozsvald.com/2011/06/29/high-performance-python-tutorial-v0-1-from-my-4-hour-tutorial-at-europython-2011/
Short (45 min) version of my 'Pragmatic Real-World Scala' talk. Discussing patterns and idioms discovered during 1.5 years of building a production system for finance; portfolio management and simulation.
Odessapy2013 - Graph databases and PythonMax Klymyshyn
Page 10 "Я из Одессы я просто бухаю." translation: I'm from Odessa I just drink. Meaning his drinking a lot of "Vodka" ^_^ (@tuc @hackernews)
This is local meme - when someone asking question and you will look stupid in case you don't have answer.
Alex Smola at AI Frontiers: Scalable Deep Learning Using MXNetAI Frontiers
In this talk at AI Frontiers Conference, Alex Smola gives a brief overview over the features used to scale deep learning using MXNet. It relies on a mix between declarative and imperative programming to achieve efficiency while also allowing for significant flexibility for the user. It relies on a distributed (key, value) store for synchronization between GPUs and between machines. It also relies on the separation between a highly efficient execution engine and language bindings to achieve a high degree of flexibility between different languages while offering a native feel in each of them. Alex also briefly discusses how Amazon AWS can help deploy deep learning models and outline steps on our future roadmap.
Scala is becoming the language of choice for many development teams. This talk highlights how Scala excels in the world of multi-core processing and explores how it compares to Java 8.
Video Presentation: http://youtu.be/8vxTowBXJSg
Robotics classes in mumbai
best Robotics classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
How Fannie Mae Leverages Data Quality to Improve the BusinessDLT Solutions
James Barrett, Data Quality Service Manager in Enterprise Data, Operations & Technology at Fannie Mae, shares how Fannie Mae leverages data quality to improve the business at the 2015 Informatica Government Summit.
Vibrant Technologies is headquarted in Mumbai,India.We are the best Robotics training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Robotics classes in Mumbai according to our students and corporates
contact us on : http://vibranttechnologies.co.in/
How to Accelerate Backup Performance with Dell DR Series Backup AppliancesDLT Solutions
Join us for a live demonstration of Dell DR series disk backup and disaster recovery appliances. Learn how to transform your backup operations without the pain of replacing your existing backup software. DR series appliances can be deployed in any environment quickly and easily – fast and affordable data reduction with the future built in. Discover how to easily accelerate backup performance, reduce backup storage footprint, and simplify disaster recovery.
Cloud Ready Data: Speeding Your Journey to the CloudDLT Solutions
Ronen Schwartz, Vice President and General Manager Informatica Cloud at Informatica, shares how to speed your journey to the cloud from the 2015 Informatica Government Summit.
GET READY FOR INTEL'S KNIGHTS LANDING
As the leading provider of code modernization and optimization training, Colfax now offers a 1-hour webinar: “Introduction to Next-Generation Intel® Xeon Phi™ Processor: Developer’s Guide to Knights Landing”.
ANOTHER LEAP IN PARALLEL PERFORMANCE
Next-generation Intel Xeon Phi processors codenamed Knights Landing (KNL) are expected to provide up to 3X higher performance than the current generation. With on-board high-bandwidth memory and optional integrated high-speed fabric—plus the availability of socket form-factor —these powerful components will transform the fundamental building block of technical computing.
The transformation of scalable manycore to a processor is going to be a remarkable in the parallel computing field and we are offering help to developers worldwide on getting the best out of the new processor. The webinar will help get you up to speed with:
- Knights Landing architecture
- New KNL features
- Code transition and modernization strategy
MULTIPLE RUNS AND FLEXIBLE TIMINGS FOR ALL GEOS
The webinar will air multiple times at different time slots making it convenient for developers worldwide to attend the webinar.
REGISTER TODAY
at http://colfaxresearch.com/knl-webinar/
Experts from immixGroup’s Market Intelligence organization identify and explain targeted sales opportunities for COTS manufacturers and solution providers and discuss how to navigate the complex waters of DOD. Topics will include agency IT budgets, organizational landscapes, major acquisition drivers, and FY15 programs. Click here to view the full presentation: http://immixgroup.com/Resources/Webcasts/Market-Intelligence-FY15-Defense-Budget/
VVTA: RFP 2015-03: CNG Fuel Cylinder Replacement
PURPOSE: Victor Valley Transit Authority (VVTA) is seeking contractors to remove, install, inspect and certify compressed natural gas (CNG) cylinders on eight (8) forty-foot (40’) transit buses. Replacements are required due to the impending expiration of the cylinders in late 2015 and early 2016. Replacement tasks shall include, but not be limited to forty eight (48) cylinders, hardware, soft parts, inspection and system certification.
SDN Security: Two Sides of the Same CoinZivaro Inc
When it comes to Software Defined Networking (SDN) Security there are two sides of the story. This webinar addresses both sides – what security vulnerabilities exist in modern SDN technologies and how SDN technologies can create new security protections. Also included are use cases that SDN solutions can provide and the new applications of SDN that can secure modern enterprise and data center environments.
Presented by GTRI CTO, Scott Hogg, in a webinar on June 9, 2016. For more information, visit http://www.gtri.com/.
Insider threats come in a variety of forms and may be malicious or simply the result of negligence. Insider attacks can cause more damage than outsider threats, so it is important that organizations understand how to protect against and remedy insider threats. Learn more about insider threats and GTRI's Insider Threat Security Solution in this presentation. (Source: GTRI)
This presentation includes information about Cisco Stealthwatch, which goes beyond conventional threat detection and harnesses the power of NetFlow. With it, you get advanced network visibility, analytics, and protection. You see everything happening across your network and data center. And you can uncover attacks that bypass the perimeter and infiltrate your internal environment. (Source: Cisco)
Python is a high level language focused on readability. The Python community developed the concept of "Pythonic Code", requiring not only semantic correctness, but also conformity to universally acknowledged stylistic criteria.
A pre-requisite to write pythonic code is to write idiomatic code. Using the right idioms is a matter of acquired taste and experience, however, some idioms are quite easy to learn.
This presentation focuses on some of these idioms and other stylistic criteria:
* for vs. while
* iterators, itertools
* code conventions (space invaders)
* avoid default values bugs
* first order functions
* internal/external iterators
* substituting the switch statement
* properties, attributes, read only objects
* named tuples
* duck typings
* bits of metaprogramming
* exception management: LBYL vs. EAFP
Vibrant Technologies is headquarted in Mumbai,India.We are the best Business Analyst training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Business Analyst classes in Mumbai according to our students and corporators
This presentation is about -
History of ITIL,
ITIL Qualification scheme,
Introduction to ITIL,
For more details visit -
http://vibranttechnologies.co.in/itil-classes-in-mumbai.html
This presentation is about -
Create & Manager Users,
Set organization-wide defaults,
Learn about record accessed,
Create the role hierarchy,
Learn about role transfer & mass Transfer functionality,
Profiles, Login History,
For more details you can visit -
http://vibranttechnologies.co.in/salesforce-classes-in-mumbai.html
This presentation is about -
Based on as a service model,
• SAAS (Software as a service),
• PAAS (Platform as a service),
• IAAS (Infrastructure as a service,
Based on deployment or access model,
• Public Cloud,
• Private Cloud,
• Hybrid Cloud,
For more details you can visit -
http://vibranttechnologies.co.in/salesforce-classes-in-mumbai.html
This presentation is about -
Introduction to the Cloud Computing ,
Evolution of Cloud Computing,
Comparisons with other computing techniques fetchers,
Key characteristics of cloud computing,
Advantages/Disadvantages,
For more details you can visit -
http://vibranttechnologies.co.in/salesforce-classes-in-mumbai.html
This presentation is about -
Designing the Data Mart planning,
a data warehouse course data for the Orion Star company,
Orion Star data models,
For more details Visit :-
http://vibranttechnologies.co.in/sas-classes-in-mumbai.html
This presentation is about -
Working Under Change Management,
What is change management? ,
repository types using change management
For more details Visit :-
http://vibranttechnologies.co.in/sas-classes-in-mumbai.html
This presentation is about -
Overview of SAS 9 Business Intelligence Platform,
SAS Data Integration,
Study Business Intelligence,
overview Business Intelligence Information Consumers ,navigating in SAS Data Integration Studio,
For more details Visit :-
http://vibranttechnologies.co.in/sas-classes-in-mumbai.html
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
3. Introduction
Most recent popular
(scripting/extension) language
although origin ~1991
heritage: teaching language (ABC)
Tcl: shell
perl: string (regex) processing
object-oriented
rather than add-on (OOTcl)
4. Python philosophy
Coherence
not hard to read, write and maintain
power
scope
rapid development + large systems
objects
integration
hybrid systems
5. Python features
no compiling or linking rapid development cycle
no type declarations simpler, shorter, more flexible
automatic memory management garbage collection
high-level data types and
operations
object-oriented programming code structuring and reuse, C++
embedding and extending in C mixed language systems
classes, modules, exceptions "programming-in-the-large" support
dynamic loading of C modules simplified extensions, smaller
dynamic reloading of C modules programs can be modified without
Nov 6, 2014 Advanced
fast development
binaries
stopping
Programming
Lutz, Programming Python
6. Python features
Lutz, Programming Python
universal "first-class" object model fewer restrictions and rules
run-time program construction handles unforeseen needs, end-user
coding
interactive, dynamic nature incremental development and
testing
access to interpreter information metaprogramming, introspective
objects
wide portability cross-platform programming
without ports
compilation to portable byte-code execution speed, protecting source
code
built-in interfaces to external
services
system tools, GUIs, persistence,
databases, etc.
7. Python
elements from C++, Modula-3
(modules), ABC, Icon (slicing)
same family as Perl, Tcl, Scheme,
REXX, BASIC dialects
Nov 6, 2014 Advanced
Programming
8. Uses of Python
Advanced
Programming
shell tools
system admin tools, command line programs
extension-language work
rapid prototyping and development
language-based modules
instead of special-purpose parsers
graphical user interfaces
database access
distributed programming
Internet scripting
9. What not to use Python (and
kin) for
most scripting languages share these
not as efficient as C
but sometimes better built-in algorithms
(e.g., hashing and sorting)
delayed error notification
lack of profiling tools
Nov 6, 2014 Advanced
Programming
10. Using python
/usr/local/bin/python
#! /usr/bin/env python
interactive use
Python 1.6 (#1, Sep 24 2000, 20:40:45) [GCC 2.95.1 19990816 (release)] on sunos5
Copyright (c) 1995-2000 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.
>>>
python –c command [arg] ...
python –i script
read script first, then interactive
Nov 6, 2014 Advanced
Programming
11. Python structure
modules: Python source files or C extensions
import, top-level via from, reload
Advanced
Programming
statements
control flow
create objects
indentation matters – instead of {}
objects
everything is an object
automatically reclaimed when no longer needed
12. First example
#!/usr/local/bin/python
# import systems module
import sys
marker = '::::::'
for name in sys.argv[1:]:
input = open(name, 'r')
print marker + name
print input.read()
Nov 6, 2014 Advanced
Programming
13. Basic operations
Nov 6, 2014 Advanced
Programming
Assignment:
size = 40
a = b = c = 3
Numbers
integer, float
complex numbers: 1j+3, abs(z)
Strings
'hello world', 'it's hot'
"bye world"
continuation via or use """ long text """"
14. String operations
concatenate with + or neighbors
word = 'Help' + x
word = 'Help' 'a'
subscripting of strings
'Hello'[2] 'l'
slice: 'Hello'[1:2] 'el'
word[-1] last character
len(word) 5
immutable: cannot assign to subscript
Advanced
Programming
15. Lists
lists can be heterogeneous
a = ['spam', 'eggs', 100, 1234, 2*2]
Lists can be indexed and sliced:
a[0] spam
a[:2] ['spam', 'eggs']
Lists can be manipulated
a[2] = a[2] + 23
a[0:2] = [1,12]
a[0:0] = []
len(a) 5
Nov 6, 2014 Advanced
Programming
16. Basic programming
a,b = 0, 1
# non-zero = true
while b < 10:
# formatted output, without n
print b,
# multiple assignment
a,b = b, a+b
Nov 6, 2014 Advanced
Programming
17. Control flow: if
x = int(raw_input("Please enter #:"))
if x < 0:
x = 0
print 'Negative changed to zero'
Nov 6, 2014 Advanced
Programming
elif x == 0:
print 'Zero'
elif x == 1:
print 'Single'
else:
print 'More'
no case statement
18. Control flow: for
a = ['cat', 'window', 'defenestrate']
for x in a:
print x, len(x)
no arithmetic progression, but
range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(len(a)):
print i, a[i]
do not modify the sequence being iterated
over
Nov 6, 2014 Advanced
Programming
19. Loops: break, continue, else
break and continue like C
else after loop exhaustion
for n in range(2,10):
for x in range(2,n):
if n % x == 0:
print n, 'equals', x, '*', n/x
break
Nov 6, 2014 Advanced
Programming
else:
# loop fell through without finding a factor
print n, 'is prime'
20. Do nothing
pass does nothing
syntactic filler
while 1:
Advanced
Programming
pass
21. Defining functions
Nov 6, 2014 Advanced
Programming
def fib(n):
"""Print a Fibonacci series up to n."""
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
>>> fib(2000)
First line is docstring
first look for variables in local, then global
need global to assign global variables
22. Functions: default argument
values
def ask_ok(prompt, retries=4,
complaint='Yes or no, please!'):
Nov 6, 2014 Advanced
Programming
while 1:
ok = raw_input(prompt)
if ok in ('y', 'ye', 'yes'): return 1
if ok in ('n', 'no'): return 0
retries = retries - 1
if retries < 0: raise IOError,
'refusenik error'
print complaint
>>> ask_ok('Really?')
23. Keyword arguments
last arguments can be given as keywords
def parrot(voltage, state='a stiff', action='voom',
type='Norwegian blue'):
print "-- This parrot wouldn't", action,
print "if you put", voltage, "Volts through it."
print "Lovely plumage, the ", type
print "-- It's", state, "!"
parrot(1000)
parrot(action='VOOOM', voltage=100000)
Nov 6, 2014 Advanced
Programming
24. Lambda forms
anonymous functions
may not work in older versions
def make_incrementor(n):
return lambda x: x + n
f = make_incrementor(42)
f(0)
f(1)
Advanced
Programming
25. List methods
Nov 6, 2014 Advanced
Programming
append(x)
extend(L)
append all items in list (like Tcl lappend)
insert(i,x)
remove(x)
pop([i]), pop()
create stack (FIFO), or queue (LIFO) pop(0)
index(x)
return the index for value x
26. List methods
Nov 6, 2014 Advanced
Programming
count(x)
how many times x appears in list
sort()
sort items in place
reverse()
reverse list
27. Functional programming
tools
filter(function, sequence)
def f(x): return x%2 != 0 and x%3 0
filter(f, range(2,25))
map(function, sequence)
call function for each item
return list of return values
reduce(function, sequence)
return a single value
call binary function on the first two items
then on the result and next item
iterate
Nov 6, 2014 Advanced
Programming
28. List comprehensions (2.0)
Create lists without map(),
filter(), lambda
= expression followed by for clause +
zero or more for or of clauses
>>> vec = [2,4,6]
>>> [3*x for x in vec]
[6, 12, 18]
>>> [{x: x**2} for x in vec}
[{2: 4}, {4: 16}, {6: 36}]
Nov 6, 2014 Advanced
Programming
29. List comprehensions
cross products:
>>> vec1 = [2,4,6]
>>> vec2 = [4,3,-9]
>>> [x*y for x in vec1 for y in vec2]
[8,6,-18, 16,12,-36, 24,18,-54]
>>> [x+y for x in vec1 and y in vec2]
[6,5,-7,8,7,-5,10,9,-3]
>>> [vec1[i]*vec2[i] for i in
range(len(vec1))]
[8,12,-54]
Nov 6, 2014 Advanced
Programming
30. List comprehensions
can also use if:
>>> [3*x for x in vec if x > 3]
[12, 18]
>>> [3*x for x in vec if x < 2]
[]
Nov 6, 2014 Advanced
Programming
31. del – removing list items
remove by index, not value
remove slices from list (rather than by
assigning an empty list)
>>> a = [-1,1,66.6,333,333,1234.5]
>>> del a[0]
>>> a
[1,66.6,333,333,1234.5]
>>> del a[2:4]
>>> a
[1,66.6,1234.5]
Nov 6, 2014 Advanced
Programming
32. Tuples and sequences
lists, strings, tuples: examples of
sequence type
tuple = values separated by commas
>>> t = 123, 543, 'bar'
>>> t[0]
123
>>> t
(123, 543, 'bar')
Nov 6, 2014 Advanced
Programming
33. Tuples
Tuples may be nested
>>> u = t, (1,2)
>>> u
((123, 542, 'bar'), (1,2))
kind of like structs, but no element names:
(x,y) coordinates
database records
like strings, immutable can't assign to
individual items
Nov 6, 2014 Advanced
Programming
35. Tuples
sequence unpacking distribute
elements across variables
>>> t = 123, 543, 'bar'
>>> x, y, z = t
>>> x
123
packing always creates tuple
unpacking works for any sequence
Nov 6, 2014 Advanced
Programming
36. Dictionaries
like Tcl or awk associative arrays
indexed by keys
keys are any immutable type: e.g., tuples
but not lists (mutable!)
uses 'key: value' notation
>>> tel = {'hgs' : 7042, 'lennox': 7018}
>>> tel['cs'] = 7000
>>> tel
Nov 6, 2014 Advanced
Programming
37. Dictionaries
no particular order
delete elements with del
>>> del tel['foo']
keys() method unsorted list of keys
>>> tel.keys()
['cs', 'lennox', 'hgs']
use has_key() to check for existence
>>> tel.has_key('foo')
0
Nov 6, 2014 Advanced
Programming
38. Conditions
can check for sequence membership with is
and is not:
>>> if (4 in vec):
... print '4 is'
chained comparisons: a less than b AND b
equals c:
Nov 6, 2014 Advanced
Programming
a < b == c
and and or are short-circuit operators:
evaluated from left to right
stop evaluation as soon as outcome clear
39. Conditions
Can assign comparison to variable:
>>> s1,s2,s3='', 'foo', 'bar'
>>> non_null = s1 or s2 or s3
>>> non_null
foo
Unlike C, no assignment within
expression
Nov 6, 2014 Advanced
Programming
40. Comparing sequences
unlike C, can compare sequences (lists,
tuples, ...)
lexicographical comparison:
compare first; if different outcome
continue recursively
subsequences are smaller
strings use ASCII comparison
can compare objects of different type, but
by type name (list < string < tuple)
Nov 6, 2014 Advanced
Programming
42. Modules
collection of functions and variables,
typically in scripts
definitions can be imported
file name is module name + .py
e.g., create module fibo.py
def fib(n): # write Fib. series up to n
...
def fib2(n): # return Fib. series up to n
Nov 6, 2014 Advanced
Programming
43. Modules
import module:
import fibo
Use modules via "name space":
>>> fibo.fib(1000)
>>> fibo.__name__
'fibo'
can give it a local name:
>>> fib = fibo.fib
>>> fib(500)
Nov 6, 2014 Advanced
Programming
44. Modules
function definition + executable statements
executed only when module is imported
modules have private symbol tables
avoids name clash for global variables
accessible as module.globalname
can import into name space:
>>> from fibo import fib, fib2
>>> fib(500)
can import all names defined by module:
>>> from fibo import *
Nov 6, 2014 Advanced
Programming
45. Module search path
current directory
list of directories specified in PYTHONPATH
environment variable
uses installation-default if not defined, e.g.,
.:/usr/local/lib/python
uses sys.path
>>> import sys
>>> sys.path
['', 'C:PROGRA~1Python2.2', 'C:Program
FilesPython2.2DLLs', 'C:Program
FilesPython2.2lib', 'C:Program
FilesPython2.2liblib-tk', 'C:Program
FilesPython2.2', 'C:Program FilesPython2.2libsite-packages']
Nov 6, 2014 Advanced
Programming
46. Compiled Python files
include byte-compiled version of module if
there exists fibo.pyc in same directory as
fibo.py
only if creation time of fibo.pyc matches
fibo.py
automatically write compiled file, if possible
platform independent
doesn't run any faster, but loads faster
can have only .pyc file hide source
Nov 6, 2014 Advanced
Programming
47. Standard modules
system-dependent list
always sys module
>>> import sys
>>> sys.p1
'>>> '
>>> sys.p2
'... '
>>> sys.path.append('/some/directory')
Nov 6, 2014 Advanced
Programming
49. Classes
mixture of C++ and Modula-3
multiple base classes
derived class can override any methods of its
base class(es)
method can call the method of a base class
with the same name
objects have private data
C++ terms:
all class members are public
all member functions are virtual
no constructors or destructors (not needed)
Nov 6, 2014 Advanced
Programming
50. Classes
classes (and data types) are objects
built-in types cannot be used as base
classes by user
arithmetic operators, subscripting can
be redefined for class instances (like C+
+, unlike Java)
Nov 6, 2014 Advanced
Programming
51. Class definitions
Class ClassName:
<statement-1>
...
<statement-N>
must be executed
can be executed conditionally (see Tcl)
creates new namespace
Nov 6, 2014 Advanced
Programming
52. Namespaces
mapping from name to object:
built-in names (abs())
global names in module
local names in function invocation
attributes = any following a dot
z.real, z.imag
attributes read-only or writable
module attributes are writeable
Nov 6, 2014 Advanced
Programming
53. Namespaces
scope = textual region of Python program
where a namespace is directly accessible
(without dot)
innermost scope (first) = local names
middle scope = current module's global names
outermost scope (last) = built-in names
assignments always affect innermost scope
don't copy, just create name bindings to objects
global indicates name is in global scope
Nov 6, 2014 Advanced
Programming
54. Class objects
obj.name references (plus module!):
class MyClass:
"A simple example class"
i = 123
def f(self):
return 'hello world'
>>> MyClass.i
123
MyClass.f is method object
Nov 6, 2014 Advanced
Programming
55. Class objects
class instantiation:
>>> x = MyClass()
>>> x.f()
'hello world'
creates new instance of class
note x = MyClass vs. x = MyClass()
___init__() special method for
initialization of object
def __init__(self,realpart,imagpart):
self.r = realpart
self.i = imagpart
Nov 6, 2014 Advanced
Programming
56. Instance objects
attribute references
data attributes (C++/Java data
members)
created dynamically
x.counter = 1
while x.counter < 10:
x.counter = x.counter * 2
print x.counter
del x.counter
Nov 6, 2014 Advanced
Programming
57. Method objects
Called immediately:
x.f()
can be referenced:
Nov 6, 2014 Advanced
Programming
xf = x.f
while 1:
print xf()
object is passed as first argument of
function 'self'
x.f() is equivalent to MyClass.f(x)
58. Notes on classes
Data attributes override method
attributes with the same name
no real hiding not usable to
implement pure abstract data types
clients (users) of an object can add data
attributes
first argument of method usually called
self
'self' has no special meaning (cf. Java)
Nov 6, 2014 Advanced
Programming
59. Another example
Nov 6, 2014 Advanced
Programming
bag.py
class Bag:
def __init__(self):
self.data = []
def add(self, x):
self.data.append(x)
def addtwice(self,x):
self.add(x)
self.add(x)
60. Another example, cont'd.
Nov 6, 2014 Advanced
Programming
invoke:
>>> from bag import *
>>> l = Bag()
>>> l.add('first')
>>> l.add('second')
>>> l.data
['first', 'second']
61. Inheritance
class DerivedClassName(BaseClassName)
<statement-1>
...
<statement-N>
search class attribute, descending
chain of base classes
may override methods in the base class
call directly via BaseClassName.method
Nov 6, 2014 Advanced
Programming
62. Multiple inheritance
class DerivedClass(Base1,Base2,Base3):
<statement>
depth-first, left-to-right
problem: class derived from two classes
with a common base class
Nov 6, 2014 Advanced
Programming
63. Private variables
No real support, but textual
replacement (name mangling)
__var is replaced by
_classname_var
prevents only accidental modification,
not true protection
Advanced
Programming
64. ~ C structs
Empty class definition:
class Employee:
pass
john = Employee()
john.name = 'John Doe'
john.dept = 'CS'
john.salary = 1000
Advanced
Programming
65. Exceptions
syntax (parsing) errors
while 1 print 'Hello World'
File "<stdin>", line 1
while 1 print 'Hello World'
^
SyntaxError: invalid syntax
exceptions
run-time errors
e.g., ZeroDivisionError,
NameError, TypeError
Nov 6, 2014 Advanced
Programming
66. Handling exceptions
Nov 6, 2014 Advanced
Programming
while 1:
try:
x = int(raw_input("Please enter a number: "))
break
except ValueError:
print "Not a valid number"
First, execute try clause
if no exception, skip except clause
if exception, skip rest of try clause and use except
clause
if no matching exception, attempt outer try
statement
67. Handling exceptions
try.py
import sys
for arg in sys.argv[1:]:
try:
f = open(arg, 'r')
except IOError:
print 'cannot open', arg
else:
print arg, 'lines:', len(f.readlines())
f.close
e.g., as python try.py *.py