Comando | Descripción |
---|---|
ESC | Volver al modo de comandos. También se usa para cancelar comandos. |
Ctrl+F | Avanzar una página hacia adelante |
Ctrl+B | Avanzar una página hacia atrás |
Ctrl+L | Refrescar pantalla |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# probado Python 2.7.6 | |
x = 2.5 | |
y = 7.5 | |
total = x + y | |
print '%g + %g = %g ' % (x, y, total) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
json_string = '{"Language":[{"Name":"Python"},{"Name":"Ruby"},{"Name":"Java"},{"Name":"C"},{"Name":"PHP"}]}' | |
data = json.loads(json_string) | |
i=0 | |
for lenguaje in data['Language']: | |
print '- ' + str(data['Language'][i]['Name']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Socket Client Example | |
import socket | |
HOST = 'localhost' # El host remoto | |
PORT = 9999 # El puerto del host remoto | |
s = socket.socket() | |
s.connect((HOST, PORT)) |
Esta guía indica como instalar Ruby 2.3.0 usando chruby + ruby install y Ruby o Rails 4.2.5. Está guía aplica tanto para Debian 7.0 como para Ubuntu 14.04, pero probablemente sirve para otras distribuciones Linux, incluyendo versiones más recientes de Ubuntu y Debian.
Primero que todo actualizar el listado de paquetes disponibles:
sudo apt-get update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
def jugar(intento = 1): | |
print "\n¿Cuanto es 2 x 2?" | |
respuesta = int(raw_input("> ")) | |
if respuesta != 4: | |
max = 3 | |
if intento < max: | |
print "\nRespuesta incorrecta. Intentalo nuevamente, te quedan " + str(max - intento) + " intento(s)" | |
intento += 1 |