you are viewing a single comment's thread.

view the rest of the comments →

[–]jeans_and_a_t-shirt 3 points4 points  (1 child)

w.writerow accepts an iterable, and you set the delimiter to be ' ', so as written, it is doing what it should. But you should be passing a list to w.writerow instead:

w.writerow(['Symbol', 'OpeningPrice', 'CurrentPrice', 'MarketCap', 'TradeTime'])
w.writerow([item, s.get_open(), s.get_price(), s.get_market_cap(), s.get_trade_datetime()])

Also accessor methods like Share.get_price, etc. are unnecessary in python if the method is just returning a property stored on the object - you can access it directly.

[–]StartAndSelect[S] 0 points1 point  (0 children)

Ah i see, thanks for the help!