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 Mensajes
Páginas: 1 2 3 [4] 5
31  Programación / Scripting / Re: [Python] Ayuda con intefaz grafica!! en: 20 Mayo 2010, 17:09 pm
No te entendi  :huh:
32  Programación / Scripting / Re: [Python] Ayuda con intefaz grafica!! en: 20 Mayo 2010, 16:43 pm
Gracias Novlucker por eso. Y ahora otra cosa xD
para poner un texto al lado de cada recuadro he hecho esto:

Código:
wx.Frame.__init__(self, parent=None, title='Ecuaciones 2 grado')
        self.btnCalcular = wx.Button(self, label='Calcular', pos=(20, 180), size=(60, 30))
        self.a = wx.TextCtrl(self, pos=(20,45), size=(60,20))
        self.b = wx.TextCtrl(self, pos=(20,70), size=(60,20))
        self.c = wx.TextCtrl(self, pos=(20,95), size=(60,20))
        self.d = wx.TextCtrl(self, pos=(20,120), size=(60,20))
        self.e = wx.TextCtrl(self, pos=(20,145), size=(60,20))
        wx.StaticTex(self, label='Introduzca a', pos=(10,45))
        wx.StaticTex(self, label='Introduzca b', pos=(10,70))
        wx.StaticTex(self, label='Introduzca c', pos=(10,95))
        wx.StaticTex(self, label='Resultado postivo', pos=(10,120))
        wx.StaticTex(self, label='Resultado negativo', pos=(10,145))
        self.Bind(wx.EVT_BUTTON, self.ecuacion, self.btnCalcular)

pero al ejecutarlo no sale el texto  xD. Si me pudieras ayudar...  :D
33  Programación / Scripting / Re: [Python] Ayuda con intefaz grafica!! en: 20 Mayo 2010, 16:23 pm
creo que ya lo arregle. Era problema en la funcion "ecuacion" que he puesto los SetValue como str porque los int no los coge bien creo

Asi me quedo:

Código
  1.    def ecuacion(self, event):
  2.        try:
  3.            a = int(self.a.GetValue())
  4.            b = int(self.b.GetValue())
  5.            c = int(self.c.GetValue())
  6.            self.d.SetValue(str((-b + math.sqrt(b*b - 4*a*c))/(2*a)))
  7.            self.e.SetValue(str((-b - math.sqrt(b*b - 4*a*c))/(2*a)))
  8.  
  9.        except:
  10.            self.d.SetValue('Sin solucion')
  11.            self.e.SetValue('Sin solucion')
  12.  
34  Programación / Scripting / [Python] Ayuda con intefaz grafica!! en: 20 Mayo 2010, 16:10 pm
El caso es que estoy traspasando un programilla que hice a wxpython. El problema es que tengo hecho el code pero me da error en la linea 20 en negativa = ... y no se que es. Si me pudierais ayudar...

Aqui os dejo el code:

Código
  1. import wx
  2. import math
  3.  
  4. class Herr(wx.Frame):
  5.  
  6.  def __init__(self):
  7.    wx.Frame.__init__(self, parent=None, title='Ecuaciones 2 grado')
  8.  
  9.    self.btnCalcular = wx.Button(self, label='Calcular', pos=(20, 180), size=(60, 30))
  10.  
  11.    self.a = wx.TextCtrl(self, pos=(20,45), size=(60,20))
  12.    self.b = wx.TextCtrl(self, pos=(20,70), size=(60,20))
  13.    self.c = wx.TextCtrl(self, pos=(20,95), size=(60,20))
  14.    self.d = wx.TextCtrl(self, pos=(20,120), size=(60,20))
  15.    self.e = wx.TextCtrl(self, pos=(20,145), size=(60,20))
  16.    self.Bind(wx.EVT_BTN, self.ecuacion, self.btnCalcular)
  17.  
  18. def ecuacion(self, event):
  19.    try:
  20.        a = self.a.GetValue()
  21.        b = self.b.GetValue()
  22.        c = self.c.GetValue()
  23.  
  24.        positiva = self.d.SetValue((-b + math.sqrt(b*b - 4*a*c))/(2*a))
  25.        negativa = self.e.SetValue((-b - math.sqrt(b*b - 4*a*c))/(2*a))        
  26.  
  27.  
  28.    except:
  29.        positiva = self.d.SetValue('Sin solucion')
  30.        negativa = self.e.SetValue('Sin solucion')  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. class App(wx.App):
  38.    def OnInit(self):
  39.        frame = Herr()
  40.        frame.Show()
  41.        self.SetTopWindow(frame)
  42.        return True
  43.  
  44.  
  45. if __name__ == '__main__':
  46.    app = App()
  47.    app.MainLoop()
35  Foros Generales / Foro Libre / Re: ¿Cuantas horas dormis al dia? en: 19 Mayo 2010, 16:26 pm
Pues yo entre semana a las 23:30 ó 24 y me levanto a las 7 - 7:15 xD
36  Informática / Software / Re: DaW Ultimate Notepad - ¡Pruébalo! en: 14 Mayo 2010, 17:18 pm
Os quedo muy bien wind  ;D
37  Programación / Scripting / Telnet Tool by swik [Python] en: 4 Mayo 2010, 15:22 pm
Aqui os dejo esta pequeña tool que hice para hacer telnet a una ip. Primero la escanea, y luego le hace telnet  ;D. Es algo antiguo pero bueno

Código
  1. print '-------------------------------------'
  2. print '-------------------------------------'
  3. print '--------Telnet Hacking Tool----------'
  4. print '-------------by swik-----------------'
  5. print '-------------------------------------'
  6. print '-------------------------------------'
  7.  
  8. print ''
  9.  
  10.  
  11. print '-Para hacer el ataque con exito, es necesario que la victima'
  12. print ''
  13. print '-Tenga el port 23 abierto'
  14. print ''
  15. print '-Teclee la ip de la victima y presione enter'
  16. print ''
  17. print '-El usuario y pass por defecto es admin-admin'
  18. print ''
  19. print '-La pag que se ha abierto contiene el user y pass de algunos routers'
  20. print ''
  21. print '-Primero el programa escanea la ip y luego le hace telnet'
  22.  
  23. import os
  24.  
  25. os.system("color a")
  26. victima = raw_input('ip victima: ')
  27. escan = os.system("nmap %s" % victima)
  28. os.system("start http://phenoelit-us.org/dpl/dpl.html")
  29. os.system("telnet %s" % victima)
  30. os.system("color c")
38  Programación / Scripting / Re: Pequeño conversor by swik [Python] en: 18 Abril 2010, 10:36 am
Me podrias ayudar un poco  ;D es que llevo muy poco tiempo en python  ;D

Seria algo asi ¿no?

Código:
import urllib
 
peticion = urllib.urlopen("http://www.web.com").read()
39  Programación / Programación General / Re: ¿Qué lenguajes de programación usas? en: 17 Abril 2010, 16:57 pm
Python ;D
40  Programación / Scripting / Calculadora básica by swik en: 17 Abril 2010, 16:45 pm
Aqui os dejo otro pequeño programa basico (una calculadora)  :)

Código:
import math

print "n %%_________Calculadora_______%%"
print "n %%__________by swik__________%%"


#Calculadora Basica by swik
salir = 'no'






#elegir la operacion
print 'escoge una opcion: '
print '(+)'
print '(-)'
print '(/)'
print '(*)'
print '(^)'

operacion = raw_input ('teclea la operacion a usar, y luego presiona enter: ')
numeroA = float (raw_input('Tecle un numero: '))
numeroB = float (raw_input('Teclea otro numero: '))

if operacion == '+': #realiza operacion de suma
resultado = numeroA + numeroB

if operacion == '-': #realiza la operacion de resta
resultado = numeroA - numeroB

if operacion == '/': #realiza la operacion dividir
resultado = numeroA / numeroB

if operacion == '*': #realiza la operacion multiplicar
resultado = numeroA * numeroB

if operacion == '^': #realiza la operacion elevar
resultado = numeroA ** numeroB

print resultado
raw_input ()
Páginas: 1 2 3 [4] 5
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines