Advertisement
Guest User

Untitled

a guest
Oct 15th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1.     def set_steps(self, stepsarray): #INSERTS transaction start time to Evidence Step:{"sold/bought":"","step_amount":"","exec_Date":"","Stock":"","pair":"","price":""}
  2.         for i in range(0,len(stepsarray)):
  3.             print(len(stepsarray))
  4.             print(list(dict(stepsarray[i]).keys()))
  5.             for j in range(0,len(list(dict(stepsarray[i]).keys()))):
  6.                 print(list(dict(stepsarray[i]).keys())[j])
  7.                 if str(list(dict(stepsarray[i]).keys())[j])=='sold/bought'or'step_amount'or'exec_date'or'Stock'or'pair'or'price':
  8.                     print(list(dict(stepsarray[i]).keys())[j],"Equals 'sold/bought'or'step_amount'or'exec_date'or'Stock'or'pair'or'price'")
  9.                     self.new_index['Steps'] = stepsarray
  10.                     self.save_data()
  11.                 else:
  12.                     print("Wrong argument dict_list syntax")
  13.                     raise SyntaxError("StepDictionary")
  14. a=Evidence()
  15. a.set_steps([{'krowa':'sold','step_amount':'1500','exec_date':'09/10/2017','Stock':'Forex','pair':'EURPLN','price':'4.24'},{'sold/bought':'sold','step_amount':'1500','exec_date':'09/10/2017','Stock':'Forex','pair':'EURPLN','price':'4.24'}])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement