This file contains 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
import os | |
os.chdir("/etc") #Directorio donde trabajaremos | |
def borrar(): | |
"""Metodo que borra los dns asignados por el modem recursivamente""" | |
f = open("resolv.conf") | |
g = open("resolv.conf","w") | |
linea = f.readline() | |
while linea != "": | |
g.write(linea) |
This file contains 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
# -*- coding: utf-8 -*- | |
# | |
# Python version: 2.6.6 | |
# Developer by: @itrogeno | |
# Date: 24-05-2011 | |
# Description: Implementacion de un Arbol Binario en Python. | |
class Tree(): | |
'''Arbol Binario''' | |
This file contains 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
from collections import deque #Libreria para colas | |
stack=[] #Declaro el stack | |
queue= deque([]) #Declaro la Cola | |
def pila(palabra): | |
"""Almacena la palabra parceada (Sin espacios ni mayusculas) | |
letra por letra en un stack y al sacarla se retorna al reves""" | |
regresar="" | |
for i in palabra: |
This file contains 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/env | |
#-*- encoding: -utf-8-*- | |
centinela=None | |
x=[] | |
def inicio(): | |
b= raw_input("ingrese un elemento: ") | |
x.insert(0,b) | |
def final(): |
This file contains 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
/*************************************************************************\ | |
* PROGRAMA QUE MUESTRA EL MANEJO DE LISTAS SIMPLEMENTE ENLAZADAS * | |
* La lista es de caracteres * | |
\*************************************************************************/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/*******************************************************************\ |
This file contains 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
print "Hola" | |
estado= None | |
y= None | |
while 1: | |
A= input ("Dame el valor de A") | |
B= input ("Dame el valor de B") | |
if A==1: |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int a=0; //Declaración de variable entera de tipo entero | |
int *puntero; //Declaración de variable puntero de tipo entero | |
puntero = &a; //Asignación de la dirección memoria de a | |
char *ptr; |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
void main(void){ | |
int *vector; /*creo el vector a entero*/ | |
int n, i; | |
printf ("Elementos a introducir:"); |
This file contains 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/env | |
#-*- encoding: -utf-8-*- | |
class trabajador: | |
"""Objeto del Tipo trabajador""" | |
def __init__(self): | |
self.nombre = None | |
self.ap_paterno= None | |
self.ap_mat= None | |
self.edad= None |
This file contains 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/env python | |
# coding utf-8 | |
import getpass | |
import crypt | |
semilla = 'sl' | |
pass_unix = getpass.getpass() | |
def login_user(semilla,pass_unix): |
NewerOlder