Ejemplo n.º 1
0
	def create_wallet(self):
		#create a wallet for this node, with a public key and a private key
		random_gen = Crypto.Random.new().read
		private_key = RSA.generate(1024, random_gen)
		public_key = private_key.publickey()		#check for binascii
		public_key_string = str(base64.b64encode(public_key.exportKey(format='DER')),'utf-8')
		private_key_string = str(base64.b64encode(private_key.exportKey(format='DER')),'utf-8')
		return wallet(public_key_string, private_key_string, [])
Ejemplo n.º 2
0
 def __init__(self):
 	self.multiple = 1
 	self.chess = [EVEN]
 	self.stack = []
 	self.wallet = wallet()
     self.counter = Seller()
     self.curCost = 0
     self.num = 2
     self.cnt = 0
     self.errCnt = 0
     self.reMultiple = 1
     pass
Ejemplo n.º 3
0
 def __init__(self):
     self.multiple = 1
     self.chess = [EVEN]
     self.stack = []
     self.wallet = wallet()
     self.counter = Seller()
     self.curCost = 0
     self.num = 2
     self.cnt = 0
     self.errCnt = 0
     self.reMultiple = 1
     pass
Ejemplo n.º 4
0
 def select(self):
     file_name = self.file_name.get()
     if file_name == "academy.py":
         academy(self)
     if file_name == "basicCalc.py":
         basicCalc(self)
     if file_name == "click_counter.py":
         click_counter(self)
     if file_name == "calendar.py":
         calendar(self)
     if file_name == "color_changer.py":
         color_changer(self)
     if file_name == "color_quiz.py":
         color(self)
     if file_name == "disney_princess.py":
         disney_princess(self)
     if file_name == "font_change.py":
         font_change(self)
     if file_name == "hogwarts_house.py":
         hogwarts(self)
     if file_name == "mad_lib.py":
         madlib(self)
     if file_name == "mean_median.py":
         mean_median(self)
     if file_name == "meme_gen.py":
         meme_gen(self)
     if file_name == "menu.py":
         menu(self)
     if file_name == "Periodic_table.py":
         Periodic_table(self)
     if file_name == "rand_num_gen.py":
         rand_num_gen(self)
     if file_name == "spiritAnimal.py":
         spiritAnimal(self)
     if file_name == "surprise.py":
         surprise(self)
     if file_name == "third_grade_quiz.py":
         third_grade_quiz(self)
     if file_name == "wallet.py":
         wallet(self)
Ejemplo n.º 5
0
 def __init__(self,
              mode="prod",
              delta=2,
              size=20,
              risk=0.5,
              bet=0.5,
              buyLimit=0.5,
              sellLimit=0.5):
     self.risk = risk
     self.bet = bet
     self.buyLimit = buyLimit
     self.sellLimit = sellLimit
     self.wallet = wallet(mode)
     self.bollinger = bollinger(mode, delta, size)
     self.watch(int(size / 2 + 1))
Ejemplo n.º 6
0
    # Aumenta di n il numero dei trafficanti
    def addDealers(self, num):
        self.nDealers += num

    # Ritorna il numero di trafficanti
    def getDealers(self):
        return self.nDealers

    # Modifica il numero dei trafficanti
    def setDealers(self, num):
        self.nDealers = num

    # Mette a lavorare i trafficanti
    def makeMoney(self, wallet):
        while True:
            wallet.addMoney(3 * self.nDealers)
            time.sleep(10)


if __name__ == "__main__":
    stdscr = curses.initscr()

    wallet = wallet()
    dealers = Dealers()
    dealers.setDealers(1)

    stdscr.refresh()
    stdscr.getch()
    curses.endwin()