elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Temas
Páginas: [1]
1  Programación / Scripting / Mi tercer progrma en Tkinter, error! en: 9 Febrero 2019, 12:28 pm
https://www.lawebdelprogramador.com/codigo/Python/4752-Simple-cronometro-con-TK.html

from tkinter import Tk,Label,Button,Frame

proceso=0

def iniciar(contador=0):

    global proceso

    time['text'] = contador

 
    proceso=time.after(1000, iniciar, (contador+1))

 

def parar():

    global proceso
        
        time.after_cancel(proceso)

 
root = Tk()

root.title('Cronometro')


time = Label(root, fg='red', width=20, font=("","18"))

time.pack()


frame=Frame(root)

btnIniciar=Button(frame, fg='blue', text='Iniciar', command=iniciar)

btnIniciar.grid(row=1, column=1)

btnParar=Button(frame, fg='blue', text='Parar', command=parar)

btnParar.grid(row=1, column=2)

frame.pack()


root.mainloop()
2  Programación / Scripting / Mi primer ejercicio con Tkinter en: 8 Febrero 2019, 20:03 pm
Emepze con Tkinter i aproveche un script de dar informacion i con un boton de salida, pero mi texto es demasiado grande para el tamaño i no consigo ver como hacer mas grande la ventana sin interferir a los botones. Alguien sabria como verlo mas grande.


https://jordixicarspython.wordpress.com/2019/02/08/prueba-con-tkinter/
3  Programación / Scripting / Validar ejercicio2 mediante el ejercicio 1 en: 8 Febrero 2019, 15:42 pm
Quiero entar los datos del erjercio 1 i que me rederrecione al ejercico 2 una vez los datos sean correctos. Soy inesperto en pyhton asi que si alguein sabe de algun comando que me contese al mensaje

https://jordixicarspython.files.wordpress.com/2019/02/programilla-1.png?w=680

https://jordixicarspython.files.wordpress.com/2019/02/mesmenu.png
4  Programación / Scripting / Ejericio 2 python: Menu, cual es el numero del mes en: 8 Febrero 2019, 14:33 pm
Esto es un programa donde podemos ver el numero de mes.

def pedirNumeroEntero():
 
    correcto=False
    num=0
    while(not correcto):
        try:
            num = int(input("Introduce el numero de mes: "))
            correcto=True
        except ValueError:
            print('Error, introduce un numero entero')
    
    return num
 
salir = False
opcion = 0
 
while not salir:
 
    print ("\n1. Enero")
    print ("2. Febrero")
    print ("3. Marzo")
    print ("4. Abril")
    print ("5. Mayo")
    print ("6. Junio")
    print ("7. Julio")
    print ("8. Agosto")
    print ("9. Septiemnbre")
    print ("10. Octubre")
    print ("11. Noviembre")
    print ("12. Diciembre")
    print ("13. Salir")
    print ("\nElige una opcion")
 
    opcion = pedirNumeroEntero()
 
    if opcion == 1:
        print ("\n*********Enero*********")
    elif opcion == 2:
        print ("\n*********Febrero*********")
    elif opcion == 3:
        print("\n*********Marzo*********")
    elif opcion == 4:
        print ("\n*********Abril*********")
    elif opcion == 5:
        print ("\n*********Mayo*********")
    elif opcion == 6:
        print("\n*********Junio*********")
    elif opcion == 7:
        print ("\n*********Julio*********")
    elif opcion == 8:
        print("\n*********Agosto*********")
    elif opcion == 9:  
            print ("\n*********Septiembre*********")
    elif opcion == 10:
        print("\n*********Ocutbre*********")
    elif opcion == 11:  
            print ("\n*********Noviembre*********")
    elif opcion == 12:
            print("\n*********Diciembre*********")
    elif opcion == 13:
        salir = True
    else:
        print ("Introduce un numero entre 1 y 12")
 
print ("Fin")
5  Programación / Scripting / Ejericio python 1: valdir usuario contraseña i email en: 8 Febrero 2019, 14:31 pm
Este es un mini programa donde podemos ver si l'usauario, la contraseña i el email son correctos

import re
while True:
    
    error=1
    
    usuario=input("\n**Nombre de usuario:**\n")
    
    pass1=input("**Contrasena:**\n")
    
    pass2=input("**Repite contrasena::**\n")
    
    email=input("**E-mail:**\n")
    
 
    if len(usuario)<8 or len(usuario)>12:
              
        print("###La longitud del usuario no es correcta###")
        
        error=0

    elif len(pass1)<8  or len(pass2)<8 or not re.search('[0-9]',pass1) or pass1!=pass2:

        print("###La contraseña es incorrecte##")

        error=0
        
                              
    if len(email)<8 or not re.search('
  • ',email):
               
        print ("###L'email es incorrecte.###")
        
        error=0
        
    
    if error==1:

        print("###OK###")
        
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines