This is a python course for beginners, intended both for frontal class learning as well as self-work.
The Course is designed for 2 days and then another week of HW assignments.
Intro to Python Workshop San Diego, CA (January 19, 2013)Kendall
These slides were presented at the Intro to Python Workshop in San Diego, California on January 19, 2013. This workshop was for absolute beginners in Python, and builds from the ground up. There were two projectors used in the presentation, one for showing these slides and one with a command-line Python prompt to show the execution of example code throughout the presentation.
The presenters were David Neiss and Kendall Chuang of the San Diego Python Users Group.
Python Ecosystem for Beginners - PyCon Uruguay 2013Hannes Hapke
"From a python beginner to a django developer in 6 months" is a compilation of learning resources for programming beginners. Hannes tells his story of learning Python and shows how the Pros (e.g. Jacob Kaplan-Moss) learned the programming language.
Intro to Python Workshop San Diego, CA (January 19, 2013)Kendall
These slides were presented at the Intro to Python Workshop in San Diego, California on January 19, 2013. This workshop was for absolute beginners in Python, and builds from the ground up. There were two projectors used in the presentation, one for showing these slides and one with a command-line Python prompt to show the execution of example code throughout the presentation.
The presenters were David Neiss and Kendall Chuang of the San Diego Python Users Group.
Python Ecosystem for Beginners - PyCon Uruguay 2013Hannes Hapke
"From a python beginner to a django developer in 6 months" is a compilation of learning resources for programming beginners. Hannes tells his story of learning Python and shows how the Pros (e.g. Jacob Kaplan-Moss) learned the programming language.
IPython is an interactive Python shell, it provides tools for interactive and parallel computing that are widely used in the scientific world. It can also benefit any other Python developer.
A quick overview of why to use and how to set up iPython notebooks for researchAdam Pah
A quick overview of why to use and how to set up iPython notebooks for research in the Amaral lab. Example notebook is a gist at:
http://nbviewer.ipython.org/gist/anonymous/f8e6d8985d2ea0e4bab1
Beginning nxt programming_workshop in Computer education robotics whoevgjvvvv...OhSoAwesomeGirl
It's all about ROBOTICS. so it can be helpful. get me? hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbdon't think that i am stupid whahahahahahahahaha
Data Science Salon: Deep Learning as a Product @ ScribdFormulatedby
Presented by Kevin Perko, Head of Data Science at Scribd
Next DSS NYC Event 👉 https://datascience.salon/newyork/
Next DSS LA Event 👉 https://datascience.salon/la/
Kevin will cover his experience using deep learning, going from scratch to deploying models in production to improve the product experience. He goes in-depth in terms of how we started deep learning from scratch, including navigating the maze of frameworks and hyper-parameters to optimize. Kevin will discuss pitfalls of using other people's algorithms and make a call for more rigor in publishing data science blog posts. Kevin closes with how his failure turned into an open source contribution and the work in moving from dev to production.
YouTube Link: https://youtu.be/tSjR7bk1Y9U
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'How To Make A Chatbot In Python' will help you understand how you can use Chatterbot library in python to make a chatbot from scratch. Following are the topics discussed:
What Is A Chatbot?
ChatterBot In Python
Trainer For The Chatbot
Use Case - Flask Chatbot
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
This presentation is a part of the COP2271C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce Freshmen students to both the process of software development and to the Python language.
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
A video of Dr. Anderson using these slides is available on YouTube at: https://www.youtube.com/watch?feature=player_embedded&v=_LxfIQuFALY
Thumb.co.il is the best web-based video format inspector tool ever created. This is an overview of the reasons for creating thumbcoil and a peek into some of the cool technology contained therein.
Infrastructure as code might be literally impossible / Joe Domato (packageclo...Ontico
HighLoad++ 2017
Зал «Мумбай», 7 ноября, 12:00
Тезисы:
http://www.highload.ru/2017/abstracts/2918.html
This talk will begin by briefly examining what it means for infrastructure to be represented as code. We'll examine some fundamental software components required for automating infrastructure such as GPG, package managers, SSL, and more. We'll examine some interesting failure cases for these tools and how these shortcomings might make infrastructure as code impossible, for now.
IPython is an interactive Python shell, it provides tools for interactive and parallel computing that are widely used in the scientific world. It can also benefit any other Python developer.
A quick overview of why to use and how to set up iPython notebooks for researchAdam Pah
A quick overview of why to use and how to set up iPython notebooks for research in the Amaral lab. Example notebook is a gist at:
http://nbviewer.ipython.org/gist/anonymous/f8e6d8985d2ea0e4bab1
Beginning nxt programming_workshop in Computer education robotics whoevgjvvvv...OhSoAwesomeGirl
It's all about ROBOTICS. so it can be helpful. get me? hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbdon't think that i am stupid whahahahahahahahaha
Data Science Salon: Deep Learning as a Product @ ScribdFormulatedby
Presented by Kevin Perko, Head of Data Science at Scribd
Next DSS NYC Event 👉 https://datascience.salon/newyork/
Next DSS LA Event 👉 https://datascience.salon/la/
Kevin will cover his experience using deep learning, going from scratch to deploying models in production to improve the product experience. He goes in-depth in terms of how we started deep learning from scratch, including navigating the maze of frameworks and hyper-parameters to optimize. Kevin will discuss pitfalls of using other people's algorithms and make a call for more rigor in publishing data science blog posts. Kevin closes with how his failure turned into an open source contribution and the work in moving from dev to production.
YouTube Link: https://youtu.be/tSjR7bk1Y9U
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on 'How To Make A Chatbot In Python' will help you understand how you can use Chatterbot library in python to make a chatbot from scratch. Following are the topics discussed:
What Is A Chatbot?
ChatterBot In Python
Trainer For The Chatbot
Use Case - Flask Chatbot
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
This presentation is a part of the COP2271C college level course taught at the Florida Polytechnic University located in Lakeland Florida. The purpose of this course is to introduce Freshmen students to both the process of software development and to the Python language.
The course is one semester in length and meets for 2 hours twice a week. The Instructor is Dr. Jim Anderson.
A video of Dr. Anderson using these slides is available on YouTube at: https://www.youtube.com/watch?feature=player_embedded&v=_LxfIQuFALY
Thumb.co.il is the best web-based video format inspector tool ever created. This is an overview of the reasons for creating thumbcoil and a peek into some of the cool technology contained therein.
Infrastructure as code might be literally impossible / Joe Domato (packageclo...Ontico
HighLoad++ 2017
Зал «Мумбай», 7 ноября, 12:00
Тезисы:
http://www.highload.ru/2017/abstracts/2918.html
This talk will begin by briefly examining what it means for infrastructure to be represented as code. We'll examine some fundamental software components required for automating infrastructure such as GPG, package managers, SSL, and more. We'll examine some interesting failure cases for these tools and how these shortcomings might make infrastructure as code impossible, for now.
Intel RealSense & Depth cameras expected usage in the coming years.
Robotics, Drones, Autonomous cars, Gestures, 3D scanning, Bio signature and many others.
Code and some more technical details are available at https://github.com/IntelRealSense/librealsense
The industrial internet of things present the fastest growing IoT market, aiming for reduction in cost, TTM and rise in quality.
This is the presentation from the Israeli System e.g conference.
Intel and Amazon - Powering your innovation together. Eran Shlomo
In these slides we go over the current joined offering from Intel and amazon, the coming great technologies and how the two companies are creating synergy that boost your innovation and productivity.
This was presented in TLV AWS loft Mar 2017.
OOP Is More Then Cars and Dogs - Midwest PHP 2017Chris Tankersley
When developers are introduced to Object Oriented Programming, one of the first things that happens is that they are taught that nouns turn into objects, verbs into methods, and Dog is a subclass of Animal. OOP is more than just turning things into classes and objects and showing that both Boats and Cars have motors, and that Dogs and Cats both speak(). Let's look at OOP in real world settings and go beyond cars and dogs, and see how to use Object Oriented Programming properly in PHP. Traits, Composition, Inheritance, none of it is off limits!
A short introduction to the more advanced python and programming in general. Intended for users that has already learned the basic coding skills but want to have a rapid tour of more in-depth capacities offered by Python and some general programming background.
Execrices are available at: https://github.com/chiffa/Intermediate_Python_programming
Introduction to Python for Security ProfessionalsAndrew McNicol
This webcast introduces Python for security professionals. The goal is to inspire others to push past the initial learning curve to harness the power of Python. This is just a quick glance at the power that awaits anyone willing to gain the skill. If you are looking for more resources check out DrapsTV's YouTube channel.
A story of how we went about packaging perl and all of the dependencies that our project has.
Where we were before, the chosen path, and the end result.
The pitfalls and a view on the pros and cons of the previous state of affairs versus the pros/cons of the end result.
During this session, we will write one of the most basic of all programs. The purpose of this exercise is to learn the basics of MATLAB’s integrated development environment (IDE). We will learn basic ways in which we can make MATLAB report information back to the user. Namely, the disp() function and how to print information to a text file. For the later, we will quickly introduce some string formatting.
Scientist meets web dev: how Python became the language of dataGael Varoquaux
Python started as a scripting language, but now it is the new trend everywhere and in particular for data science, the latest rage of computing. It didn’t get there by chance: tools and concepts built by nerdy scientists and geek sysadmins provide foundations for what is said to be the sexiest job: data scientist.
In this talk I give a personal perspective on the progress of the scientific Python ecosystem, from numerical physics to data mining. What made Python suitable for science; Why the cultural gap between scientific Python and the broader Python community turned out to be a gold mine; And where this richness might lead us.
The talk will discuss low-level and high-level technical aspects, such as how the Python world makes it easy to move large chunks of number across code. It will touch upon current technical details that make scikit-learn and joblib stand.
Similar to PyCourse - Self driving python course (20)
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
2. About me
Haifa IoT Ignition lab and IPP(Intel ingenuity partnership program) tech lead.
Intel Perceptual computing.
Python expert, started around 2009 with silicon analytics.
Focus on Data science and Machine learning in recent years (A lot of python).
3. About the PyCourse
Self driving course
Just follow the slides, it is built both for self work as well as class work.
If you are not in class make sure to read the attached references and links.
If you are in class then read them later.
4. Why do you want to learn python ?
• Very fast prototyping.
• Cross platform.
• Rich libraries and capabilities.
• Good interactive/console experience.
• Fast engine (in script land)
• The leading language in AI world.
• More on The good, The bad and the ugly of python can be found here:
https://www.slideshare.net/EranShlomo/python-the-good-the-bad-and-the-ugly
5. Before we start
• Download and Install python 2.7
• Download, do not install :
• Download, python 3.5, pycharm, miniconda and google python classes.
6. Hello world
• Lets check we have python installed and good to go:
• Go to the folder you have extracted the course package zip, lets call it our working dir
• Open cmd in your working dir and check python is functional and in the right (2.7.12) version:
• If no python update your path, if version is incorrect change path variable order, you can check its
properly configured using where :
Lets make a simple hello world file and run it, create a file called hello.py and put in it a single
line printing hello:
• print "hello pycourse“
• Save and run it in cmd console:
• python hello.py
•
No python, in cmd type : set
PATH=C:Python27;%PATH%
7. Python versions
Python versions have significant importance, Python world struggles to move between
versions and there are many compatibility issues. Lets run our script on python 3:
• Install python 3.5.2
• Open cmd on working dir
• Set python 3 path to take priority :set PATH=<python 3 path>;%PATH%
• Run python - - version and make sure python version is right.
• Run our hello: fails …. Fix it:
• In python 3 print is no longer statement but function , many more differences…
• See more : http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html
8. Packaging
Python packing is pretty messy with a lot of ambiguity, today in python community the two leading
ones are:
• Easy_install – 2004, python first significant attempt to supply packaging mechanism
• Pip – 2008, alternative to easy_install and the common one as of today.
For more details : https://packaging.python.org/pip_easy_install/
There are two main aspect to packaging:
• I want to use packages in my project
• I want to package my project for others – out of this course scope.
Lets install a package, virtualenv:
• In command line, working dir (we are still in python 3) type: pip install virtualenv
9. Our python root
Being familiar with your python root structure is very important, many times
debug will take you there.
Lets look for our virtualenv package install:
• Go to python home, reminder where python will show you home.
• Under Lib you will find the packages and models (later on difference) that
comes with install. You will also find a folder called site-packages - our freshly
installed virtualenv package is there.
• Any packages we install will go there as well, which becomes pretty messy
after a while as different project requires different packages and versions.
10. Virtual environments
In order to allow developers easily develop between versions (many times you need to
work on many different version on the same machine) we have virtualenv package.
More details : http://docs.python-guide.org/en/latest/dev/virtualenvs/
This package allows you to create an isolated python environments, each with its own
dependencies and navigate between them. Lets create virtural environment:
• In our work dir type in console :virtualenv pycourse
• This creates virtual environment with the name pycourse, and installs base python +
setuptools into it, notice virtual env folder was created under sub dir pycourse
• Activate the virtualenv , in cmd type : .pycourseScriptsactivate
• And now deactivate it , in cmd type : .pycourseScriptsdeactivate
11. Module and packages
• Python has two main mechanisms for managing code blocks: modules and packages. Both
are almost the same conceptually, packages allows you to create more complex file structures
and name spaces:
• Module – single .py file
• Package – directory with __init__.py in it, can conatain sub packages.
Lets create an hello module and run it :
create a file called hello_mod.py with the code, print ("hello pycourse module”)
Create a subfolder called hello_pack, inside it create a file called __init__.py with the code,
print ("hello pycourse package ”)
create a file called main.py with the following :
Run main.py :
Read more on the matter http://knowpapa.com/modpaclib-py/
12. Function
Lets make a function in hello mod:
• Python uses indentation as block, use 4 spaces for every block. Indentation rules can be found
here but keeping in mind 4 spaces in what usually is {}:
• Using Ide usually takes care of that for you easily.
• http://www.peachpit.com/articles/article.aspx?p=1312792&seqNum=3
Add function to hello_mod.py so it look like:
Lets run it, this time in console: run python in cmd, this will get you into interactive interpreter
mode. Now you can code directly into the interpreter. Import the module and call the function:
.
.
.
13. Time to IDE
Once we go into more coding IDE becomes extremely usefull, There are many IDEs out there, we will be using
JetBrains Pycharm, install it (download or take from course distribution).
Lets create a project with our code:
• File Create new project
• Put location of your work dir, choose interpreter of your python 3.5.2 install.
•
• Pycharm will warn on existing code, confirm it – it will create project with your code.
• Run main on ide, now run menu is empty :
• Right click main.py and click run main:
• And now run menu is active, with main as default run config:
• Put a breakpoint in the hello function and click debug :
• Debug button :
14. Classes
So we have an IDE working, pycharm is a great distribution of eclipse & pydev, so if you are
coming from JAVA you might feel at home pretty fast.
Python have two type of classes : classic and new style, always use the new style, notice the
pass keyword:
More on pass: https://www.tutorialspoint.com/python/python_pass_statement.htm
More on class stype differences:
http://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-
classes-in-python
Create an hello class inside hello_mod, new style as follows:
notice the self reference, it’s the python equivalent of this
Run main in pycharm and see in output console the result
CLASSIC
NEW
15. Wrapping point – short exercise
Build an image class rotator, Using the pillow package. Do the following:
• Install the Pillow package
• Build a class rotator with the following methods:
• Load – load an image to the rotator, parameter :im_path
• Rotate – rotate the image , parameter :rotation
• save– saves the currently rotated image, parameter :im_path
• Run the following code using your class and lena.jpg (inside project package, or choose
image of your choice) to get rotated images:
• Take the time to understand the code, first time we see loop and string formatting
16. PEPs
Python is developed and progress using PEPs, Python Enhancements Proposal
This is how community decides on language future and features, PEP0 contains the full
list: https://www.python.org/dev/peps/
As you are becoming python programmer, let go over PEP8:
• Authored by Guido, contains the “right syntax style” to python.
• Stick to PEP8
• PyCharm actually mark you where you got it wrong:
• Two violations here, import not on top, missing two blank lines.
• Nice feature : PyCharm contains auto fix under CodeReformat code
Read PEP20, we will get back to it later - https://www.python.org/dev/peps/pep-0020/
17. Time to revisit our project folder
So while we are inside our nice and cozy IDE stuff is happening under the hood.
Important to stay in touch in the underlying project folder(especially if you manage joint
development and source control):
• So what do we have there now ?
• .idea folder – this is where pycharm stores it magic
• __pycache__ - this is where python caches the complied modules, read more here
http://stackoverflow.com/questions/2998215/if-python-is-interpreted-what-are-pyc-files
• Pycourse – the virtual env folder we used – Can you find PIL in there ?
• Our modules and package
• And a bunch of lena rotated images.
• Clean your work folder be fore we continue.
18. Google python classes
A great collection of python function you need to code, gradually covering
different python aspects while allowing you to test your code.
It contains some tutorials, Videos and exercises – we will focus on the exercises:
• More details @ https://developers.google.com/edu/python
The exercises have two parts:
• Basic, python modules that you need to “solve”
• Advanced, 3 small problems you need to code.
In the class we will focus on the basic, take as HW the advanced ones.
19. Setting our environment
• Create a new python project
• Add the basic subfolder into it
• Run string1.py, you have a bug fix it
• Notice the print formatting in the files is different then the one we have seen so far. You can use both.
• The flow for each file:
• Module is running main(), what is the difference from what we did so far (calling main in the module)?
• Main calls test function with different inputs
• Each test is calling your function implementation, marking pass(OK)/fail (X) on console.
• You need to make it all pass , fail example :
• Lets start
20. String1.py
• You need to implement 4 strings manipulation functions:
• Each marked with letter (A,B,C,D).
• Each has instructions what is needed
• Each has a function signature
Solve all 4 functions, tips:
• Each module comes with reading page, read it.
• You can run it as many times as you want, work iteratively
• Google is your friend
• Use python console for fast experimenting
• Use debugger and break points and inspection.
• Combine both debugger and interactive –
21. Lets complete the rest
Complete rest of the modules, with the following order:
• String2
• List1, List2
• Wordcount
• If you got the time then go for mimic as well
Keep in mind every module has details in the google classes , strings details for
example :
https://developers.google.com/edu/python/strings
22. Recommendation for your next steps -
Recommended order
• Complete the advanced google execrcises
• Cover these shortly :docstrings, lambda functions, inheritance, getters and setter, decorators.
• Package your code using setuptools.
• Repeat the above using wheels.
• Learn about generators and iterators.
• Download and install miniconda package manager, install tensor flow using conda.
• Write multi-thread python program and see how fast it is:
• Network bounded – web page fetches.
• CPU bounded – count till 10^9
• Repeat the above using one of python multithread libs : twisted, gevent, async
• Learn how to use PYTHONPATH, write a pth file
• Install pip that requires build during install (like opencv)
• Write extension for python using c
• Use c extention from python
23. Just before we go – PEP20
The zen of python, use it as a mantra to an endless journey
Lets go over them.
24. 1.Beautiful is better than ugly.
2.Explicit is better than implicit.
3.Simple is better than complex.
4.Complex is better than complicated.
5.Flat is better than nested.
6.Sparse is better than dense.
7.Readability counts.
8.Special cases aren't special enough to break the rules.
9.Although practicality beats purity.
10.Errors should never pass silently.
11.Unless explicitly silenced.
12.In the face of ambiguity, refuse the temptation to guess.
13.There should be one-- and preferably only one --obvious way to do it.
14.Although that way may not be obvious at first unless you're Dutch.
15.Now is better than never.
16.Although never is often better than *right* now.
17.If the implementation is hard to explain, it's a bad idea.
18.If the implementation is easy to explain, it may be a good idea.
19.Namespaces are one honking great idea -- let's do more of those!