SlideShare a Scribd company logo
LESSON SUMMARY
OOP
Git is a version control system. Distributed version control systems exist
because these systems will "merge" changes together intelligently,
enabling multiple developers to work on a project at the same time.
There are a few distributed version control systems, including Mercurial
and Bazzar. However, Git is by far the most popular.
Git is a command-line tool we can access by typing git in the shell. The
first step in using Git is to initialize a folder as a repository. A repository
(or "repo") tracks multiple versions of the files in the folder, enabling
collaboration.
We can initialize a repository by typing git init inside the folder we
want to use for our project.
The typical Git workflow
involves adding files, making
changes, and storing a
checkpoint (or "snapshot") of
those changes. These
checkpoints are called
commits.
Instead of storing every file in
every commit, Git stores the
diff, or the things that change
between commits.
Every project is a sequence of
commits. Commits give us a
powerful way to merge the
changes of multiple team
members together. We can
even restore the repository to
an earlier checkpoint, or
moment in time.
committed - The current version of the file has been added to a commit, and Git
has stored it.
staged - The file has been marked for inclusion in the next commit, but hasn't
been committed yet (and Git hasn't stored it yet). You might stage one file
before working on a second file, for example, then commit both files at the same
time when you're done.
modified - The file has been modified since the last commit, but isn't staged yet.
After we make changes to a Git repository, we can run the git status command to
check the state of each file within it. Any files that don't show up in git status are
in the committed state (i.e., don't have unsaved changes).
Files can have one of three states in Git:
Before we can make our first commit, we need to tell Git who we are so it
can store that information along with the commit. This step ensures that all of
the members on a team can tell who made a certain commit.
We can do this by running git config. We only need to run this command
once per computer, because Git will save the information.
Git needs two pieces of information about you -- your email address and your
name. You can configure your email with:
git config --global user.email "your.email@domain.com"
You can configure your name with:
git config --global user.name "Your name"
To make a commit, we use git commit -m "Commit message here".
The -m flag indicates that we're adding a message, and the text in quotes that
comes after it is the commit message itself. It's customary to make the commit
message something informative, so if we do have to rewind or merge code, it's
obvious what changes we made and when.
we can use git diff to see all of the line differences between the current
and previous version. We can scroll up and down with the arrow keys, and exit
git diff with the q key. If we want to see the differences after we stage a file, we
can use git diff --staged
We can pull up a repository's commit history using the git log command. This command will
show us a list of all of the commits to the repository, in descending order by creation date. If the
output is very long, it will allow us to scroll. We can scroll through the log with the up and down
arrows, and use the q key to exit.
We can use git log --stat to see more details about the commits in the git log output.
Command
Getting started with Git:
git
Initializing a repo:
git init
Check the state of each file:
git status
Add files to staging area:
git add
Configure identity in Git:
• Configure email
git config --global user.email
"your.email@domain.com"
• Configure name
git config --global user.name
"Your name"
Making a commit
git commit -m "Commit
message here"
Viewing the diff
• View the diff before staged
git diff
• View the diff after staged
git diff --staged
View repo's commit history
git log
Docker is basically seen as a tool. It can package our applications and
algorithms along with their dependencies. it makes it easy for us to
replicate our code or our projects, allows us to run them in the cloud or
in other environments, share them across teams, deploy containers to
production and much more.
Docker Container
A Docker container is the same idea as a physical container--think of it like a box with an
application in it. Inside the box, the application seems to have a computer all to itself: it
has its own machine name and IP address, and it also has its own disk drive (Windows
containers have their own Windows Registry too). Figure 2.2 shows how the app is boxed
by the container.
The application inside the box (container) can’t see anything
outside the box, but the box is running on a computer, and that
computer can also be running lots of other boxes. The applications
in those boxes have their own separate environments (managed by
Docker), but they all share the CPU and memory of the computer,
and they all share the computer’s operating system
List all container
docker container ps to list running container
or docker container ps -a to list all container
docker container inspect shows you all the details of a container:
Running a docker container
docker run [docker_image]
You can run containers from locally stored Docker
images. If you use an image that is not on your system,
the software pulls it from the online registry.
Run a Container Under a Specific Name
docker container run --name [container_name] [docker_image]
You can check whether you have successfully set a container name by displaying
a list of all containers (running and stopped) with the command:
docker ps -a
Stop and start container
docker container stop [CONTAINER_ID]
docker container start [CONTAINER_ID]
Exec into a running container
Sometimes, we want to run another process insi. How can we do this? First, we need to know
either the ID or the name of the container, and then we can define which process we want to run
and how we want it to run
docker exec -it [CONTAINER NAME/ID] bash
The -i flag signifies that we want to run the additional process interactively, and -t tells Docker
that we want it to provide us with a TTY (a Terminal emulator) for the command. Finally, the
process we run is bash.
OOP
Python Import
Python code is organized into both modules and packages.
In Python, you use the import keyword to make code in
one module available in another. Imports in Python are important
for structuring your code effectively. Using imports properly will
make you more productive, allowing you to reuse code while
keeping your projects maintainable.
In practice, a module usually corresponds to
one .py file containing Python code.
The true power of modules is that they can be
imported and reused in other code.
>>> import math
>>> math.pi
3.141592653589793
In the first line, import math, you import the code in
the math module and make it available to use. In the
second line, you access the pi variable within
the math module. math is part of Python’s standard
library, which means that it’s always available to import
when you’re running Python.
Modules Package
You can use a package to further organize your
modules. Note that a package is still a module. As a
user, you usually don’t need to worry about whether
you’re importing a module or a package.
The package will consist of the following
directories and files:

More Related Content

What's hot

11 Unit 1 Chapter 02 Python Fundamentals
11  Unit 1 Chapter 02 Python Fundamentals11  Unit 1 Chapter 02 Python Fundamentals
11 Unit 1 Chapter 02 Python Fundamentals
Praveen M Jigajinni
 
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Ranel Padon
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Yi-Fan Chu
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
Praveen M Jigajinni
 
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
Nicholas Pringle
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
Haitham El-Ghareeb
 
Basics of python
Basics of pythonBasics of python
Basics of python
Jatin Kochhar
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
Praveen M Jigajinni
 
Python Programming - XII. File Processing
Python Programming - XII. File ProcessingPython Programming - XII. File Processing
Python Programming - XII. File Processing
Ranel Padon
 
Python Summer Internship
Python Summer InternshipPython Summer Internship
Python Summer Internship
Atul Kumar
 
Python Collections Module
Python Collections ModulePython Collections Module
Python Collections Module
MaryamAnwar10
 
Python modules
Python modulesPython modules
Intervies
InterviesIntervies
Intervies
roopa manoharan
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
Mohd Sajjad
 
Learn python
Learn pythonLearn python
Learn python
Rokibul Islam
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
Simplilearn
 
Most Asked Python Interview Questions
Most Asked Python Interview QuestionsMost Asked Python Interview Questions
Most Asked Python Interview Questions
Shubham Shrimant
 
CORE JAVA
CORE JAVACORE JAVA
Python reading and writing files
Python reading and writing filesPython reading and writing files
Python reading and writing files
Mukesh Tekwani
 
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Codemotion
 

What's hot (20)

11 Unit 1 Chapter 02 Python Fundamentals
11  Unit 1 Chapter 02 Python Fundamentals11  Unit 1 Chapter 02 Python Fundamentals
11 Unit 1 Chapter 02 Python Fundamentals
 
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 
Python Programming - XII. File Processing
Python Programming - XII. File ProcessingPython Programming - XII. File Processing
Python Programming - XII. File Processing
 
Python Summer Internship
Python Summer InternshipPython Summer Internship
Python Summer Internship
 
Python Collections Module
Python Collections ModulePython Collections Module
Python Collections Module
 
Python modules
Python modulesPython modules
Python modules
 
Intervies
InterviesIntervies
Intervies
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
 
Learn python
Learn pythonLearn python
Learn python
 
Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...Python Interview Questions | Python Interview Questions And Answers | Python ...
Python Interview Questions | Python Interview Questions And Answers | Python ...
 
Most Asked Python Interview Questions
Most Asked Python Interview QuestionsMost Asked Python Interview Questions
Most Asked Python Interview Questions
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Python reading and writing files
Python reading and writing filesPython reading and writing files
Python reading and writing files
 
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
Functional Programming You Already Know - Kevlin Henney - Codemotion Rome 2015
 

Similar to Git, Docker, Python Package and Module

Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
Hitesh670643
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
HuthaifaAlmaqrami1
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
Git learning
Git learningGit learning
Git learning
Amit Gupta
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
AbelPhilipJoseph
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
Nyros Technologies
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
Himanshu Agrawal
 
16 Git
16 Git16 Git
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Wycliff1
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
AliaaTarek5
 
GDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptxGDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptx
ChitreshGyanani1
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
Rasan Samarasinghe
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
Mithilesh Singh
 
github_gyan.pptx
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptx
AyushSingh931502
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
Anuj Sharma
 
SessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystemsSessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystems
Hellen Gakuruh
 
Git
GitGit
Rc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocido
Luis Bertel
 

Similar to Git, Docker, Python Package and Module (20)

Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git learning
Git learningGit learning
Git learning
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
GIT By Sivakrishna
GIT By SivakrishnaGIT By Sivakrishna
GIT By Sivakrishna
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
16 Git
16 Git16 Git
16 Git
 
Git introduction
Git introductionGit introduction
Git introduction
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
GDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptxGDSC23 - Github Workshop Presentation.pptx
GDSC23 - Github Workshop Presentation.pptx
 
Advanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with GitAdvanced Web Development in PHP - Code Versioning and Branching with Git
Advanced Web Development in PHP - Code Versioning and Branching with Git
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
github_gyan.pptx
github_gyan.pptxgithub_gyan.pptx
github_gyan.pptx
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
SessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystemsSessionThree_IntroductionToVersionControlSystems
SessionThree_IntroductionToVersionControlSystems
 
Git
GitGit
Git
 
Rc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocidoRc094 010d-git 2 - desconocido
Rc094 010d-git 2 - desconocido
 

More from Novita Sari

Advanced python
Advanced pythonAdvanced python
Advanced python
Novita Sari
 
Summary python coding
Summary python codingSummary python coding
Summary python coding
Novita Sari
 
Summary machine learning and model deployment
Summary machine learning and model deploymentSummary machine learning and model deployment
Summary machine learning and model deployment
Novita Sari
 
Summary legal
Summary legalSummary legal
Summary legal
Novita Sari
 
Summary introduction to data engineering
Summary introduction to data engineeringSummary introduction to data engineering
Summary introduction to data engineering
Novita Sari
 
Summary data visualization
Summary data visualizationSummary data visualization
Summary data visualization
Novita Sari
 
Summary data modelling
Summary data modellingSummary data modelling
Summary data modelling
Novita Sari
 
Summary business knowledge for data professional
Summary business knowledge for data professionalSummary business knowledge for data professional
Summary business knowledge for data professional
Novita Sari
 
Practice case legal for data professional
Practice case legal for data professionalPractice case legal for data professional
Practice case legal for data professional
Novita Sari
 
Big data tools
Big data toolsBig data tools
Big data tools
Novita Sari
 
OOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixOOP, Networking, Linux/Unix
OOP, Networking, Linux/Unix
Novita Sari
 
Python Function and Looping
Python Function and LoopingPython Function and Looping
Python Function and Looping
Novita Sari
 
Basic Data Engineering
Basic Data EngineeringBasic Data Engineering
Basic Data Engineering
Novita Sari
 

More from Novita Sari (13)

Advanced python
Advanced pythonAdvanced python
Advanced python
 
Summary python coding
Summary python codingSummary python coding
Summary python coding
 
Summary machine learning and model deployment
Summary machine learning and model deploymentSummary machine learning and model deployment
Summary machine learning and model deployment
 
Summary legal
Summary legalSummary legal
Summary legal
 
Summary introduction to data engineering
Summary introduction to data engineeringSummary introduction to data engineering
Summary introduction to data engineering
 
Summary data visualization
Summary data visualizationSummary data visualization
Summary data visualization
 
Summary data modelling
Summary data modellingSummary data modelling
Summary data modelling
 
Summary business knowledge for data professional
Summary business knowledge for data professionalSummary business knowledge for data professional
Summary business knowledge for data professional
 
Practice case legal for data professional
Practice case legal for data professionalPractice case legal for data professional
Practice case legal for data professional
 
Big data tools
Big data toolsBig data tools
Big data tools
 
OOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixOOP, Networking, Linux/Unix
OOP, Networking, Linux/Unix
 
Python Function and Looping
Python Function and LoopingPython Function and Looping
Python Function and Looping
 
Basic Data Engineering
Basic Data EngineeringBasic Data Engineering
Basic Data Engineering
 

Recently uploaded

STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
zsjl4mimo
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
kuntobimo2016
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
g4dpvqap0
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
74nqk8xf
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
74nqk8xf
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 

Recently uploaded (20)

STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证如何办理
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 

Git, Docker, Python Package and Module

  • 2. Git is a version control system. Distributed version control systems exist because these systems will "merge" changes together intelligently, enabling multiple developers to work on a project at the same time. There are a few distributed version control systems, including Mercurial and Bazzar. However, Git is by far the most popular. Git is a command-line tool we can access by typing git in the shell. The first step in using Git is to initialize a folder as a repository. A repository (or "repo") tracks multiple versions of the files in the folder, enabling collaboration. We can initialize a repository by typing git init inside the folder we want to use for our project.
  • 3. The typical Git workflow involves adding files, making changes, and storing a checkpoint (or "snapshot") of those changes. These checkpoints are called commits. Instead of storing every file in every commit, Git stores the diff, or the things that change between commits. Every project is a sequence of commits. Commits give us a powerful way to merge the changes of multiple team members together. We can even restore the repository to an earlier checkpoint, or moment in time.
  • 4. committed - The current version of the file has been added to a commit, and Git has stored it. staged - The file has been marked for inclusion in the next commit, but hasn't been committed yet (and Git hasn't stored it yet). You might stage one file before working on a second file, for example, then commit both files at the same time when you're done. modified - The file has been modified since the last commit, but isn't staged yet. After we make changes to a Git repository, we can run the git status command to check the state of each file within it. Any files that don't show up in git status are in the committed state (i.e., don't have unsaved changes). Files can have one of three states in Git:
  • 5. Before we can make our first commit, we need to tell Git who we are so it can store that information along with the commit. This step ensures that all of the members on a team can tell who made a certain commit. We can do this by running git config. We only need to run this command once per computer, because Git will save the information. Git needs two pieces of information about you -- your email address and your name. You can configure your email with: git config --global user.email "your.email@domain.com" You can configure your name with: git config --global user.name "Your name"
  • 6. To make a commit, we use git commit -m "Commit message here". The -m flag indicates that we're adding a message, and the text in quotes that comes after it is the commit message itself. It's customary to make the commit message something informative, so if we do have to rewind or merge code, it's obvious what changes we made and when. we can use git diff to see all of the line differences between the current and previous version. We can scroll up and down with the arrow keys, and exit git diff with the q key. If we want to see the differences after we stage a file, we can use git diff --staged
  • 7. We can pull up a repository's commit history using the git log command. This command will show us a list of all of the commits to the repository, in descending order by creation date. If the output is very long, it will allow us to scroll. We can scroll through the log with the up and down arrows, and use the q key to exit. We can use git log --stat to see more details about the commits in the git log output.
  • 8. Command Getting started with Git: git Initializing a repo: git init Check the state of each file: git status Add files to staging area: git add Configure identity in Git: • Configure email git config --global user.email "your.email@domain.com" • Configure name git config --global user.name "Your name" Making a commit git commit -m "Commit message here" Viewing the diff • View the diff before staged git diff • View the diff after staged git diff --staged View repo's commit history git log
  • 9. Docker is basically seen as a tool. It can package our applications and algorithms along with their dependencies. it makes it easy for us to replicate our code or our projects, allows us to run them in the cloud or in other environments, share them across teams, deploy containers to production and much more.
  • 10. Docker Container A Docker container is the same idea as a physical container--think of it like a box with an application in it. Inside the box, the application seems to have a computer all to itself: it has its own machine name and IP address, and it also has its own disk drive (Windows containers have their own Windows Registry too). Figure 2.2 shows how the app is boxed by the container.
  • 11. The application inside the box (container) can’t see anything outside the box, but the box is running on a computer, and that computer can also be running lots of other boxes. The applications in those boxes have their own separate environments (managed by Docker), but they all share the CPU and memory of the computer, and they all share the computer’s operating system
  • 12. List all container docker container ps to list running container or docker container ps -a to list all container
  • 13. docker container inspect shows you all the details of a container:
  • 14. Running a docker container docker run [docker_image] You can run containers from locally stored Docker images. If you use an image that is not on your system, the software pulls it from the online registry.
  • 15. Run a Container Under a Specific Name docker container run --name [container_name] [docker_image] You can check whether you have successfully set a container name by displaying a list of all containers (running and stopped) with the command: docker ps -a
  • 16. Stop and start container docker container stop [CONTAINER_ID] docker container start [CONTAINER_ID]
  • 17. Exec into a running container Sometimes, we want to run another process insi. How can we do this? First, we need to know either the ID or the name of the container, and then we can define which process we want to run and how we want it to run docker exec -it [CONTAINER NAME/ID] bash The -i flag signifies that we want to run the additional process interactively, and -t tells Docker that we want it to provide us with a TTY (a Terminal emulator) for the command. Finally, the process we run is bash.
  • 18. OOP Python Import Python code is organized into both modules and packages. In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring your code effectively. Using imports properly will make you more productive, allowing you to reuse code while keeping your projects maintainable.
  • 19. In practice, a module usually corresponds to one .py file containing Python code. The true power of modules is that they can be imported and reused in other code. >>> import math >>> math.pi 3.141592653589793 In the first line, import math, you import the code in the math module and make it available to use. In the second line, you access the pi variable within the math module. math is part of Python’s standard library, which means that it’s always available to import when you’re running Python. Modules Package You can use a package to further organize your modules. Note that a package is still a module. As a user, you usually don’t need to worry about whether you’re importing a module or a package. The package will consist of the following directories and files: