INTRODUCTION TO PYTHON
Nashat Jumaah Omar
PYTHON AS A LANGUAGE
Python Is A Popular Programming Language. It Was Created By Guido
Van Rossum, And Released In 1991.
It Is Used For:
Web Development (Server-side),
Software Development,
Mathematics,
System Scripting.
Data Science
Engineering Design & Computation
PYTHON PROGRAMMING LANGUAGE
Python is used in wide range of industries.
Benefits of using python.
Large Number of libraries.
Big Community.
Huge support.
Free.
Easy to learn
Easy to share code.
Good Number of OnG Libraries
PYTHON AS A LANGUAGE
Python is Dynamically typed language meaning there is no need
to declare variable type while programming
Python Code C# Code
x = 10 int x = 10;
y = 50.5 double y = 50.5 ;
z = x + y double z ;
z = x +y ;
Python has simpler syntax and requires less typing and easier to
maintain
PYTHON DEVELOPMENT ENVIRONMENTS
Number of development environments are available for python
language ranging from simple to complex and sophisticated packages.
On of the basic IDE in python is IDLE.
Simple.
Easy to use.
Lacks most libraries.
PYTHON AS A LANGUAGE
Python is Interpretive Language meaning that each line of code
can be executed individually and results are returned at once.
Lets repeat the previous exam using python console.
Green lines are user lines
Red Lines are Console Output
Compiled Languages Like C++/C/C#/Java requires all code to be
compiled before getting any result
PYTHON PRODUCTIVITY TOOLS
Many Tool Types Are Available
For Python:
. IDE : Integrated Development Environment
Are development environments
for python usually used by
developers to create projects on
many scales.
IDEs are usually packed with
various features.
Examples :
Spyder
Pycharm
VSCode.
PYTHON-ANACONDA
Anaconda Is A Distribution Of The Python And R Programming
Languages For Scientific Computing, That Aims To Simplify Package
Management And Deployment.
Anaconda Comes With:
Large Selection of Libraries.
Spyder Text Editor.
Jupyter Lab
Package Manager
ANACONDA IS FREE
Download from
https://www.anaconda.com/products/distribution
Either 32bit or 64bit
RELEVANCY TO OIL AND GAS
Python currently is being deployed and implemented as API for
many industry leading software's, enabling petroleum engineering,
geoscientists and field personnel to create unparalleled solutions.
Here is a brief list of softwares using python:
Techlog(SLB).
OLGA.(SLB)
PIPESIM
PETEX IPM (OpenServer Wrapper)
Geolog (Paradigm)
tNavigator.
VIRTUAL PRODUCTION SYSTEM USING PYTHON
A Virtual Production
System
Is a steady state or dynamic
state representation of oil
and gas production system
with one important factoring
(C) Paradigm, METTE
Which is the capability o connect the virtual model to real time
data readings.
This is done by connecting :
Data Server + MPF Model + Programming
VIRTUAL PRODUCTION SYSTEM AS SURVEILLANCE TOOL
Data Coming From Field
Dynamic Solutions
WHP
One Way Data CHP
Flow WHT
FLP
Steady State Solutions
CHOKE
Performance Dashboard
AUTOMATING PRODUCTION MODELING
Result Dashboard
Steady State Solutions Programming
Run Engine Script/Code
Well Model Well Model Well Model Well Model
Well Model Well Model Well Model Well Model
Collect Output
• Model Descr.
• Model Properties.
Other O&G Softwares 13
RELEVANCY TO OIL AND GAS
Python Offers wide range of free libraries that are designed to
target oil and gas industry.
Here are some libraries that are helpful to people who are
working in oil and gas industry:
Library Name Description Target
Lasio Las File Reader Geoscience and petrophysics
Fluids Multiphase flow calculations Production and Flow assurance engineering
psapy VLP correlations Production engineering
Well_path Well path creator/visualizer Drilling Engineering
CoolProp PVT package Reservoir, production, flow assurance
RELEVANCY TO OIL AND GAS
Python Offers other general libraries that can be used for any industry
Here are some libraries that are helpful to people who are working in oil and gas
industry:
Pandas.
Numpy.
Matplotlib
Dash
Plotly
Streamlit
Sklearn
Scipy.
pyxl