示例#1
0
def encrypted():
    key = String(sys.argv[2])
    key = Key_matrix(key)
    message = String(sys.argv[1])
    message = Message_matrix(message, key)
    matrice = message.multiplication(key)
    display_encrypted(key, matrice)
 def __init__(self):
     self.popsize = 100
     self.total = [String() for i in range(self.popsize)]
     self.mating_pool = []
     # self.target = 'wertygvhbjskdnasdnhjbqjwe'
     # self.target = 'abcdefghij'
     self.target = 'abcdefghijklmnopqrstuvwxyz'
示例#3
0
def _(a, c):
    return String(a.string * c.value)
示例#4
0
def _(c, a):
    return String(a.string * c.value)
示例#5
0
def _(a, b):
    return String(a.string + b.string)
示例#6
0
def from_ustring(value):
    assert isinstance(value, unicode)
    return String(value)
示例#7
0
def from_cstring(value):
    assert isinstance(value, str)
    return String(value.decode('utf-8'))
示例#8
0
文件: main.py 项目: El-Treshka/Python
from string import String

# test exception
strings = ["test", "50 chars for testing String class raise exceptions"]
for i in strings:
    try:
        string = String(i)
        print("Created ", string)
    except Exception:
        print("An exception occurred")
示例#9
0
 def _string_f(screen, **kwargs):
     string_handler = String(screen, **kwargs)
     return string_handler.get_result()
示例#10
0
文件: errors.py 项目: gordol/lever
 def listattr(self):
     listing = LException.listattr(self)
     listing.append(String(u"name"))
     listing.append(String(u"strerror"))
     return listing
示例#11
0
文件: errors.py 项目: gordol/lever
 def getattr(self, name):
     if name == u"name":
         return String(self.error_name)
     if name == u"strerror":
         return String(self.strerror)
     return LException.getattr(self, name)