'why isnt python tkinter box going all the way to the bottom
in tkinter I'm making a game called pet clicker. (here is a video of it so you can get an idea what your dealing with: https://www.youtube.com/watch?v=06rdvx9-O7I) I'm trying to make a sidebar on the right side where you can get pets, but it wont go all the way to the bottom no matter how far down I put the coordinates. I have tried using it with a different pc and nothing changed. the video doesn't show the project with the sidebar but it shows what the project does and a little bit of the code. can I get some code that will add a background sidebar on the right of the screen that I can put buttons on?
CODE:
from random import randint
from tkinter import *
from tkinter import Tk, Text, Canvas, Frame, BOTH
import time
import tkinter.font as tkFont
global text
global top
top = Tk()
top.geometry("1440x800")
check = 0
coin = PhotoImage(file=r"bigcoin.png")
global coins
coins = 0
text = Text(top, height=1, width=9)
coinsfont = tkFont.Font(family="Arial", size=30, weight="bold",
slant="roman")
text.pack()
text.configure(font=coinsfont)
text.insert(1.0, str(coins))
sidebar = Canvas(top, width=2000, height=900)
sidebar.create_rectangle(2200, 0, 2600, 1555, fill="#682000",
outline='red')
sidebar.pack()
def buttonpress1():
coinsys()
global b1
b1 = Button(top, text="Coin", image=coin, command=buttonpress2)
b1.place(x=randint(100, 1400), y=randint(100, 800))
if check == 1:
b2.destroy()
top.mainloop()
def buttonpress2():
coinsys()
b1.destroy()
global b2
global check
check = 1
b2 = Button(top, text="Coin", image=coin, command=buttonpress1)
b2.place(x=randint(100, 1400), y=randint(200, 800))
text.update()
def coinsys():
update()
global coins
coins += 1
print("coins: ", coins)
def update():
try:
text.delete(1.0, "end")
except:
pass
if coins == 1:
text.insert(1.0, " coin")
else:
text.insert(1.0, " coins")
text.insert(1.0, str(coins))
buttonpress1()
Solution 1:[1]
I had to integrate :
disable-blink-features=AutomationControlled
The websites that have this are bot protected and recognize the selenium as a bot. This trick did the thing, and now they can be opened. Except that another solution was to insert the IP in the host files for the direct websites links.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Georgi Nikolov |
