|
Mostrar Mensajes
|
Páginas: 1 2 3 [4] 5
|
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: 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...
|
|
|
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: def ecuacion(self, event): try: a = int(self.a.GetValue()) b = int(self.b.GetValue()) c = int(self.c.GetValue()) self.d.SetValue(str((-b + math.sqrt(b*b - 4*a*c))/(2*a))) self.e.SetValue(str((-b - math.sqrt(b*b - 4*a*c))/(2*a))) except: self.d.SetValue('Sin solucion') self.e.SetValue('Sin solucion')
|
|
|
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: import wx import math class Herr(wx.Frame): def __init__(self): 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)) self.Bind(wx.EVT_BTN, self.ecuacion, self.btnCalcular) def ecuacion(self, event): try: a = self.a.GetValue() b = self.b.GetValue() c = self.c.GetValue() positiva = self.d.SetValue((-b + math.sqrt(b*b - 4*a*c))/(2*a)) negativa = self.e.SetValue((-b - math.sqrt(b*b - 4*a*c))/(2*a)) except: positiva = self.d.SetValue('Sin solucion') negativa = self.e.SetValue('Sin solucion') class App(wx.App): def OnInit(self): frame = Herr() frame.Show() self.SetTopWindow(frame) return True if __name__ == '__main__': app = App() app.MainLoop()
|
|
|
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 . Es algo antiguo pero bueno print '-------------------------------------' print '-------------------------------------' print '--------Telnet Hacking Tool----------' print '-------------by swik-----------------' print '-------------------------------------' print '-------------------------------------' print '' print '-Para hacer el ataque con exito, es necesario que la victima' print '' print '-Tenga el port 23 abierto' print '' print '-Teclee la ip de la victima y presione enter' print '' print '-El usuario y pass por defecto es admin-admin' print '' print '-La pag que se ha abierto contiene el user y pass de algunos routers' print '' print '-Primero el programa escanea la ip y luego le hace telnet' import os os.system("color a") victima = raw_input('ip victima: ') escan = os.system("nmap %s" % victima) os.system("start http://phenoelit-us.org/dpl/dpl.html") os.system("telnet %s" % victima) os.system("color c")
|
|
|
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) 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 ()
|
|
|
|
|
|
|