Python Programming. Python Programming for Beginners, Python Programming for Intermediates
Python
-
Upload
omar-trinidad-gutierrez-mendez -
Category
Technology
-
view
999 -
download
0
description
Transcript of Python
![Page 1: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/1.jpg)
How to become a charming snake:Learning Python!
Omar Trinidad Gutierrez Mendez
Universidad Juarez Autonoma de Tabasco
Mayo de 2011
Omar Trinidad Gutierrez Mendez
![Page 2: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/2.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 3: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/3.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 4: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/4.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 5: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/5.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 6: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/6.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 7: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/7.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 8: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/8.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 9: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/9.jpg)
Python: ¿Que es?
Un lenguaje de programacion de alto nivel
Diciembre de 1989, Holanda, Guido Van Rossum hace nacerPython
1991, primera version oficial
Por cierto: Python is Made in C
Se me olvidaba: Python es interpretado
Omar Trinidad Gutierrez Mendez
![Page 10: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/10.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 11: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/11.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 12: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/12.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 13: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/13.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 14: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/14.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 15: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/15.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 16: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/16.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 17: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/17.jpg)
¿Que me ofrece Python?
Es software libre
Es un lenguaje multiproposito
Es multiplataforma
Es relativamente facil de aprender
Sirve para juegos, celulares...
Nos ensena una nueva forma de pensar
Y sobre todo es divertido :-)
Omar Trinidad Gutierrez Mendez
![Page 18: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/18.jpg)
Sıgueme convenciendo
Ellos usan Python
Omar Trinidad Gutierrez Mendez
![Page 19: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/19.jpg)
¿Y no que ibamos a programar?
La entrada
python>>>
Salida
>>> exit()
Help! Any somebody
>>> help()help>
¿Que modulos tengo?
help> modules
Omar Trinidad Gutierrez Mendez
![Page 20: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/20.jpg)
¿Y no que ibamos a programar?
La entrada
python>>>
Salida
>>> exit()
Help! Any somebody
>>> help()help>
¿Que modulos tengo?
help> modules
Omar Trinidad Gutierrez Mendez
![Page 21: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/21.jpg)
¿Y no que ibamos a programar?
La entrada
python>>>
Salida
>>> exit()
Help! Any somebody
>>> help()help>
¿Que modulos tengo?
help> modules
Omar Trinidad Gutierrez Mendez
![Page 22: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/22.jpg)
¿Y no que ibamos a programar?
La entrada
python>>>
Salida
>>> exit()
Help! Any somebody
>>> help()help>
¿Que modulos tengo?
help> modules
Omar Trinidad Gutierrez Mendez
![Page 23: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/23.jpg)
¿Y no que ibamos a programar?
La entrada
python>>>
Salida
>>> exit()
Help! Any somebody
>>> help()help>
¿Que modulos tengo?
help> modules
Omar Trinidad Gutierrez Mendez
![Page 24: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/24.jpg)
Pero todavıa no programo
Empecemos con la calculadora avanzada
1 a , b , c = 10 , 20 . 0 , ” t r e i n t a ” #comenta r i o23 type ( a )4 type ( b )5 type ( c )67 a = Fa l s e8 type ( a )9
10 b = Fa l s e11 p r i n t ( a == b)1213 #ad i v i n a e l r e s u l t a d o
Omar Trinidad Gutierrez Mendez
![Page 25: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/25.jpg)
if ... else
1 a = 02 i f a = = 0 :3 p r i n t ( ”a es i g u a l a c e r o ” )4 e l s e :5 p r i n t ( ”a es d i f e r e n t e de ce r o ” )
Omar Trinidad Gutierrez Mendez
![Page 26: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/26.jpg)
¿Switch?
No hay switch, pero existe elif
1 a = 02 i f a = = 0 :3 p r i n t ( ”2011” )4 e l i f a = = 1 :5 p r i n t ( ”Open Source ” )6 e l i f a = = 2 :7 p r i n t ( ” Free So f tware ” )8 e l s e :9 p r i n t ( ” F in d e l menu” )
10 #e l i f e s r e a lmen t e un e l s e− i f comprimido
Omar Trinidad Gutierrez Mendez
![Page 27: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/27.jpg)
Una y otra vez
Nuestro primer programa ciclado
1 a = 02 whi le a < 1 :3 a −= 14 p r i n t ( ”programa c i c l a d o ” , a ) ,
1 #es como e l f o r e a c h en C# o PHP23 a = [1 , 1 , 2 , 3 , 5 , 8 , 1 3 , 2 1 ] #es t o es una l i s t a4 f o r i i n a :5 p r i n t i #en C es a l go como e s t o : a [ i ]
Omar Trinidad Gutierrez Mendez
![Page 28: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/28.jpg)
Quiero leer datos
raw input()
1 name = raw inpu t ( ”Dame tu nombre : ” )23 #normalmente l e e una cadena45 o l d = i n t ( r aw i npu t ( ”Dame tu edad : ” ) )67 #pero podemos hace r e l c a s t i n g
Omar Trinidad Gutierrez Mendez
![Page 29: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/29.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 30: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/30.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 31: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/31.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 32: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/32.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 33: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/33.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 34: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/34.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 35: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/35.jpg)
Ventanitas
Hay muchas librerias GUI para Python
Tkinter: Librerıa que viene por default
PyQt: Python-Qt Toolkit
Pmw: Python-Mega-Widgets
PyGTK: Python-Gnome Toolkit/GIMP
FxPy: FOX Toolkit
WxPy: Python-WXWindows
Omar Trinidad Gutierrez Mendez
![Page 36: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/36.jpg)
Nosotros usaremos WxPython
1 import wx23 miventana = wx . App ( )4 frame = wx . Frame (None , −1, ” E s c r i b e c u a l q u i e r cosa ” )5 frame . Show ( )67 miventana . MainLoop ( )
Omar Trinidad Gutierrez Mendez
![Page 37: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/37.jpg)
El modulo Numpy
1 mia r r ay = numpy . a r r a y ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ] )23 p r i n t ( m ia r r ay )45 #e s c a l a r e s en python
Crash!! Smack!! Pum!!
Que os parece si aprendemos a instalar modulos
Omar Trinidad Gutierrez Mendez
![Page 38: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/38.jpg)
El modulo Numpy
1 mia r r ay = numpy . a r r a y ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ] )23 p r i n t ( m ia r r ay )45 #e s c a l a r e s en python
Crash!! Smack!! Pum!!
Que os parece si aprendemos a instalar modulos
Omar Trinidad Gutierrez Mendez
![Page 39: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/39.jpg)
El modulo Numpy
1 mia r r ay = numpy . a r r a y ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ] )23 p r i n t ( m ia r r ay )45 #e s c a l a r e s en python
Crash!! Smack!! Pum!!
Que os parece si aprendemos a instalar modulos
Omar Trinidad Gutierrez Mendez
![Page 40: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/40.jpg)
Ya en la colita
Documento “Como Convertirse en Hacker”
¿Les gusto Python?
¿Lo van a instalar?
Omar Trinidad Gutierrez Mendez
![Page 41: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/41.jpg)
Ya en la colita
Documento “Como Convertirse en Hacker”
¿Les gusto Python?
¿Lo van a instalar?
Omar Trinidad Gutierrez Mendez
![Page 42: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/42.jpg)
Ya en la colita
Documento “Como Convertirse en Hacker”
¿Les gusto Python?
¿Lo van a instalar?
Omar Trinidad Gutierrez Mendez
![Page 43: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/43.jpg)
Ya en la colita
Documento “Como Convertirse en Hacker”
¿Les gusto Python?
¿Lo van a instalar?
Omar Trinidad Gutierrez Mendez
![Page 44: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/44.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 45: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/45.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 46: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/46.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 47: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/47.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 48: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/48.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 49: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/49.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 50: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/50.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez
![Page 51: Python](https://reader034.fdocuments.in/reader034/viewer/2022052523/555a709dd8b42a972b8b4f66/html5/thumbnails/51.jpg)
Ahora sı
Gracias al Senor Jesucristo
Gracias a los organizadores por darnos la confianza
Gracias a las personas que nos apoyaron
Gracias al Software Libre por las maravillas: Kile y LATEX
Gracias a todos ustedes por soportarnos todo este tiempo
Gracias :-)
Omar Trinidad Gutierrez Mendez