Python Course for Engineering
Applications
Instructor: Vı́ctor Hugo Alulema
Escuela Politécnica Nacional
17 de septiembre de 2018
1/8
(Quito-Ecuador) Python 17 de septiembre de 2018 1 / 8
Outline
Outline
1 Brief introduction
What is Python
Some facts about Python
2 First steps on python
2/8
(Quito-Ecuador) Python 17 de septiembre de 2018 2 / 8
Brief introduction What is Python
What is Python ?
https://www.python.org/doc/essays/blurb/
Guido van Rossum 1994
Interpreted, object-oriented, high-level programming
High-level built in data structures
Python’s simple, easy to learn syntax emphasizes readability
Python supports modules and packages, ===> code reuse
3/8
(Quito-Ecuador) Python 17 de septiembre de 2018 3 / 8
Brief introduction Some facts about Python
Python advantages
https:
//stackoverflow.com/questions/5214369/python-vs-matlab
More powerful programming language
Completely open environment
Integration with external tools
Complete toolbox/module with lots of functions and classes can be
contained in a single file (in contrast to a bunch of M-files)
More convenient for object-oriented programming
Interfacing C, C++, and fortran code is better supported
Portability: runs on more platforms (Linux, Windows , Os X)
4/8
(Quito-Ecuador) Python 17 de septiembre de 2018 4 / 8
Brief introduction Some facts about Python
Python disadvantages
Python is slower than C or C++.
Python is not a very good language for mobile development
Python is not a good choice for memory intensive tasks
Runtime errors: Still under development
Langtangen,H.P.,Barth,T.J.,&Griebel,M.(2006)
.Pythonscriptingforcomputationalscience(Vol.3).Berlin,
HeidelbergandNewYork:Springer.
5/8
(Quito-Ecuador) Python 17 de septiembre de 2018 5 / 8
Brief introduction Some facts about Python
The Zen of Python by Tim Peters
import this
""" The Zen of Python , by Tim Peters
Beautiful is better than ugly .
Explicit is better than implicit .
Simple is better than complex .
Complex is better than complicated .
Flat is better than nested .
Sparse is better than dense .
Readability counts .
If the implementation is hard to explain ,
it ’s a bad idea .
If the implementation is easy to explain ,
it may be a good idea . """
6/8
(Quito-Ecuador) Python 17 de septiembre de 2018 6 / 8
Brief introduction Some facts about Python
Simplicity
# Hello World in Python
print ( " Hello World " )
# Hello World in Java
""" public class HelloWorld {
public static void main ( String [] args ){
System . out . println (" Hello World ");
}
} """
# Hello World in C ++
""" # include < iostream >
using namespace std ;
int main (){
cout << "" Hello World " << endl ;
} """
7/8
(Quito-Ecuador) Python 17 de septiembre de 2018 7 / 8
First steps on python
Content:
Environment, IDLE Shell and Editor
Install packages
Basic Programming: Data types, Print, Input
Loops and conditionals
Review of packages and libraries (Numpy, Scipy, sympy,
matplotlib)
Functions and class
Re-use code with PIP
Advanced topics
8/8
(Quito-Ecuador) Python 17 de septiembre de 2018 8 / 8
First steps on python
Content:
pip install numpy
pip install matplotlib
pip install scipy
pip install pandas
pip install sympy
9/8
(Quito-Ecuador) Python 17 de septiembre de 2018 9 / 8