U3Dcrew
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Text To hexa - python (Source Code)

3 posters

Go down

Text To hexa - python (Source Code) Empty Text To hexa - python (Source Code)

Post by banditc0de Sun May 16, 2010 6:58 pm

Code:
#!/usr/bin/python
print "\n###############################################################"
print "##                    {{{ Text To Hexa }}}                  ##"
print "##                    {{{ HEXA To Text }}}                  ##"
print "##                    vir0e5 -[ banditc0de ]-              ##"
print "## vir0e5 | NKRI                                            ##"
print "## Notice : BOYCOTT MALAYSIAN PRODUCT FOR HUMAN RIGHTS!!!    ##"
print "############################################################### \n"
from Tkinter import *
     

from binascii import *

class AsciiHex:
  def __init__(self, master):
    frame = Frame(master)
    frame.pack()
    frame.master.title('Text to Hexa by: vir0e5')
     

    self.lascii = Label(frame, text='Text:')
    self.lascii.grid(row=0, column=0)

    self.lhex = Label(frame, text='Hexa:')
    self.lhex.grid(row=0, column=3)

    self.tascii = Text(frame, width = 45, height=16)
    self.tascii.grid(row=1, column=0, rowspan=2)

    self.thex = Text(frame, width = 45, height=16)
    self.thex.grid(row=1, column=3, rowspan=2)

    self.bascii = Button(frame, text='Text->Hexa',width = 10, height=1, command=self.asciihex)
    self.bascii.grid(row=1, column=2)

    self.bhex = Button(frame, text='Text<-Hexa', width = 10, height=1,command=self.hexascii)
    self.bhex.grid(row=2, column=2)

   
    self.footer = Button(frame, text='Exit',width = 10, height=1, foreground='blue',
                      command=quit  )
    self.footer.grid(row=7, column=2)

   
  def asciihex(self):
    self.thex.delete(1.0, END)
    a = self.tascii.get(1.0, END)
    l = len(a)-1
    w = 0
    while l>w:
      ascii = a[w:w+1]
      ascii = b2a_hex(ascii).upper() + ' '
      self.thex.insert(END, ascii)
      w=w+1

  def hexascii(self):
    self.tascii.delete(1.0, END)
    r = self.thex.get(1.0, END)
    l = len(r)-1
    u = 0
    while l>u:
      ahex = r[u:u+2]
      ahex = a2b_hex(ahex)
      self.tascii.insert(END, ahex)
      u = u+3

 
root = Tk()
app = AsciiHex(root)
root.mainloop()

share dikit....
Buat ngebantu text ke Hexa ..dan hexa ke text...
http://www.dreamincode.net/code/snippet4581.htm shoot!
banditc0de
banditc0de
V.I.P Member
V.I.P Member

Posts : 19
Reputation : 0
Join date : 2010-03-26
Age : 34
Location : ../../../../

http://vir0e5.blogspot.com

Back to top Go down

Text To hexa - python (Source Code) Empty Re: Text To hexa - python (Source Code)

Post by r3m1ck Mon May 17, 2010 10:09 am

:apn: mantap kk,, thx for share... mayan buat koleksi ular phyton di rumah,, Laughing
r3m1ck
r3m1ck
Founder u3d
Founder u3d

Posts : 111
Reputation : -1
Join date : 2010-03-06
Location : r00t

http://r3m1ck.uni.cc/

Back to top Go down

Text To hexa - python (Source Code) Empty Re: Text To hexa - python (Source Code)

Post by scr34mz Wed Jul 07, 2010 4:06 pm

mantep om...
izin coba... Very Happy

scr34mz
junior+
junior+

Posts : 47
Reputation : 0
Join date : 2010-05-03
Age : 32
Location : City Of Evil

http://ricky-cyber.blogspot.com/

Back to top Go down

Text To hexa - python (Source Code) Empty Re: Text To hexa - python (Source Code)

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum