PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 18, 2022

[FIXED] How to prevent binance-connector from printing

 September 18, 2022     binance-api-client, printing, python     No comments   

Issue

I'm using binance-connector from:

https://github.com/binance/binance-connector-python

After defining key and secret logging information, I need to run:

import logging
from binance.spot import Spot as Client
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
client = Client(key, secret)    
results=client.klines(token, "1m", limit=1440)

The last line prints the requested information, but I need to prevent this.

Is it possible to prevent this function from printing the retrieved information?

EDIT

I found that I can retrieve the same information using

import requests
tick_interval = '1m'
limit='1440'
url = 'https://api.binance.com/api/v3/klines?symbol=url'+token+'&interval='+tick_interval+'&limit='+limit
resutls = requests.get(url).json()

This doesn't print the information.

However, I would still like to know if there's some modification I can make to binance-connector library so I can prevent it from printing the retrieved information, because the library basically prints anything I ask it to retrieve, and there's information that I can only get throw this library


Solution

You have specified config_logging(logging, logging.DEBUG) that will cause debugging information to be displayed. If you don't need it then feel free to remove that line.



Answered By - funnydman
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing