0

Python newbie here. Just wrote a script and converted it to an .exe file by auto-py-to-exe. I was running the script by using the command prompt and I could see the print()'s. The thing is I converted that program to an .exe file and when I start to program command prompt is not showing up and can't see what is happening. I know that it works, but I'd like to see prints() in a text box. I tried a few solutions here, but they didn't work for me.

Any suggestions?

    window = tk.Tk()
    window.geometry("700x180")
    window.title("Crypto Arbitrage Checker")
    label_threshold = tk.Label(text="Threshold")
    label_threshold.place(x=10,y=10)
    ent_threshold = tk.Entry(width=5)
    ent_threshold.place(x=70,y=10)
    label_percentage = tk.Label(text="%")
    label_percentage.place(x=100,y=10)

.......

    btn_start = tk.Button(text="Start", command=start_press)
    btn_start.place(x=150,y=8)
    btn_stop = tk.Button(text="Stop",command=stop_checking)
    btn_stop.place(x=190,y=8)
    window.mainloop()

........

    def start_checking():
        threshold = float(ent_threshold.get())
        coin_list=[]
        for i in range(0,35):
            if(check_box_result[i].get()==1):
                coin_list.append(coins_list_text_file[i])
    
        while (True):
            if is_run==False:
                break
            for i in range(0, len(coin_list)):
                print("COIN -----> "+coin_list[i])
                max_bid_val = 0
                max_bid_place = "max_place"
                min_ask_val = 1000000000000
                min_ask_place = "min_place"
    
                # binance
                print("binance ->")
                symbol = coin_list[i] + "USDT"
                symbol_usdt_tl_binance = 'USDTTRY'
                response = requests.get('https://api.binance.com/api/v3/ticker/24hr', params={"symbol": symbol})
                binance_dic = json.loads(response.content)
                if "bidPrice" in binance_dic:
                    binance_bid_price = float(binance_dic["bidPrice"])
                    print("binance_bid_price "+str(binance_bid_price))
                    binance_askPrice = float(binance_dic["askPrice"])
                    print("binance_askPrice " + str(binance_askPrice))
                    max_bid_val = binance_bid_price
                    max_bid_place = "binance"
                    min_ask_val = binance_askPrice
                    min_ask_place = "binance"
                else:
                    print(coin_list[i] + " not in binance")
    
                if is_run == False:
                    break
Mady Daby
  • 1,271
  • 6
  • 18

0 Answers0