<commit_before>======
Pygame
======


.. image:: img/TWP58_001.jpeg
   :height: 12.501cm
   :width: 7.754cm
   :align: center
   :alt: 



Bibliografía
============


.. image:: img/TWP60_001.jpeg
   :height: 11.25cm
   :width: 9cm
   :align: center
   :alt: 


+ `Book Link <http://inventwithpython.com/>`_ 


.. image:: img/TWP60_002.jpeg
   :height: 6cm
   :width: 5.97cm
   :align: center
   :alt: 


Pygame Hello World
==================


+ No tenemos entrada con input ()
+ Entrada de mouse y teclado a través de eventos
+ Pygame usa tuplas en lugar de listas
+ Las tuplas son listas inmutables, por lo que el procesamiento es más
   eficiente
+ Las tuplas son listas entre paréntesis en lugar de corchetes
+ Ej .: (255, 255, 255)




Pygame Hello World
==================


.. code-block:: python

   import pygame, sys
   from pygame.locals import *

   #set up pygame
   pygame.init()

   #set up the window
   windowSurface = pygame.display.set_mode((500,400),0,32)
   pygame.display.set_caption('Hello world!')

   #set up the colors
   BLACK = (0,0,0)
   WHITE = (255,255,255)
   RED = (255,0,0)
   GREEN = (0,255,0)
   BLUE = (0,0,255)

   #set up fonts
   basicFont = pygame.font.SysFont(None,48)



Pygame Hello World
==================



+ pygame.locals incluiconstantes como QUIT o K_ESCAPE
+ Utilizamos sys.exit() para salir “suavemente” del programa




Pygame Hello World
==================


.. code-block :: python

   #set up the text
   text = basicFont.render('Hello world!',True,WHITE,BLUE)
   textRect = text.get_rect()
   textRect.centerx = windowSurface.get_rect().centerx
   textRect.centery = windowSurface.get_rect().centery

   #draw the white background onto the surface
   windowSurface.fill(WHITE)<commit_msg>Corregi los errores de "pygame"<commit_after>======
Pygame
======


.. image:: img/TWP58_001.jpeg
   :height: 12.501cm
   :width: 7.754cm
   :align: center
   :alt: 



Bibliografía
============


.. image:: img/TWP60_001.jpeg
   :height: 11.25cm
   :width: 9cm
   :align: center
   :alt: 


+ `Book Link <http://inventwithpython.com/>`_ 


.. image:: img/TWP60_002.jpeg
   :height: 6cm
   :width: 5.97cm
   :align: center
   :alt: 


Pygame Hello World
==================


+ No tenemos entrada con input ()
+ Entrada de mouse y teclado a través de eventos
+ Pygame usa tuplas en lugar de listas
+ Las tuplas son listas inmutables, por lo que el procesamiento es más
   eficiente
+ Las tuplas son listas entre paréntesis en lugar de corchetes
+ Ej .: (255, 255, 255)




Pygame Hello World
==================


.. code-block:: python

   import pygame, sys
   from pygame.locals import *

   #set up pygame
   pygame.init()

   #set up the window
   windowSurface = pygame.display.set_mode((500,400),0,32)
   pygame.display.set_caption('Hello world!')

   #set up the colors
   BLACK = (0,0,0)
   WHITE = (255,255,255)
   RED = (255,0,0)
   GREEN = (0,255,0)
   BLUE = (0,0,255)

   #set up fonts
   basicFont = pygame.font.SysFont(None,48)



Pygame Hello World
==================



+ pygame.locals incluiye constantes como QUIT o K_ESCAPE
+ Utilizamos sys.exit() para salir “suavemente” del programa




Pygame Hello World
==================


.. code-block :: python

   #set up the text
   text = basicFont.render('Hello world!',True,WHITE,BLUE)
   textRect = text.get_rect()
   textRect.centerx = windowSurface.get_rect().centerx
   textRect.centery = windowSurface.get_rect().centery

   #draw the white background onto the surface
   windowSurface.fill(WHITE)
{'fraction_non_alphanumeric': 0.15817923186344238, 'fraction_numerical': 0.04551920341394026, 'mean_word_length': 3.395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4862835', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1248, 'n_words': 340}