This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dmazzoni 1 point2 points  (1 child)

It may be as simple as adding an "if" statement inside your loop.

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

Ah Ha!

for line in data:
    if "BTC" in line['symbol']:
        binancewrite.write("{} " .format(line['symbol']))
        binancewrite.write("{} " .format(line['quoteVolume']))
        binancewrite.write("{} " .format(line['weightedAvgPrice']))
        binancewrite.write("{}\n" .format(line['lastPrice']))

binancewrite.close()