#NEWLINE# def IP( ip ) : #NEWLINE# #INDENT# from convertoffset import decimaltohex #NEWLINE# ip = str ( ip ) . split ( '.' ) #NEWLINE# db = [ ] #NEWLINE# db2 = [ ] #NEWLINE# for x in ip : #NEWLINE# #INDENT# db . append ( decimaltohex ( int ( x ) ) ) #NEWLINE# #UNINDENT# for x in db : #NEWLINE# #INDENT# if ( len ( x ) == 1 ) : #NEWLINE# #INDENT# x = ( '0' + x ) #NEWLINE# #UNINDENT# db2 . append ( x ) #NEWLINE# #UNINDENT# return ( '\\x' + '\\x' . join ( db2 ) )