ImDerekD

Watchlist.py(01_05)_A

Jan 5th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. #!/usr/bin/bash python
  2.  
  3. ### See Scratchflow 01_05 (2:49 PM)
  4. import csv
  5. import sys
  6. import time
  7. from time import sleep
  8. import os.path
  9.  
  10.  
  11. def show_available():
  12. with open('/Users/King/iFiles/Watchlist.csv', 'r') as csv_file:
  13. TickerID = int(0)
  14. Available_Tickers= {}
  15. Ticker = ''
  16. Filetype = int()
  17. csv_reader = csv.reader(csv_file)
  18. for row in csv_reader:
  19. TickerID += 1
  20. Ticker = str(row[0])
  21. T_ID_String = '['+str(TickerID)+']'
  22. SymbolDictionary = {T_ID_String:Ticker}
  23. Available_Tickers = SymbolDictionary
  24. for k,v in dict.items(Available_Tickers):
  25. print(k,v)
  26.  
  27. def symbol_dict():
  28. get_Symbol = input('Please enter TickerID [number] of the chosen symbol: ')
  29. with open('/Users/King/iFiles/Watchlist.csv', 'r') as csv_file:
  30. ID = int(get_Symbol)
  31. ID_List = []
  32. Symbol = ''
  33. TickerID = int(0)
  34. Available_Tickers= {}
  35. Ticker = ''
  36. Filetype = int()
  37. csv_reader = csv.reader(csv_file)
  38. for row in csv_reader:
  39. TickerID += 1
  40. ID_List.append(TickerID)
  41. Ticker = str(row[0])
  42. T_ID_String = '['+str(TickerID)+']'
  43. SymbolDictionary = {TickerID:Ticker}
  44. Available_Tickers = SymbolDictionary
  45. Symbol = Ticker
  46. for k,v in dict.items(Available_Tickers):
  47. if ID == k:
  48. print('$',v)
  49.  
  50.  
  51.  
  52.  
  53. if __name__ == "__main__":
  54. main()
Add Comment
Please, Sign In to add comment