Hi guys i need help understanding fundamental uses of variables and functions.
I created a class for a calculator:
Then i want to create window with a button using tkinter
I get no entry nor button on the screen because i cant figure out how to set their position.
This poses another question: How am i even suppose to know what parameters Entry accepts if while typing the code in PyCharm, hint is pretty much useless and gives no examples nor lists accepted parameters ?
Thanks !
I created a class for a calculator:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class calc: def mult(a,b): global result #Declaration must take place in each function. Else its local result = a * b def div(a,b): global result #Declaration must take place in each function. Else its local result = a * b def add(a,b): global result #Declaration must take place in each function. Else its local result = a * b def sub(a,b): global result #Declaration must take place in each function. Else its local result = a * b |
1 2 3 4 5 6 7 |
from tkinter import * window = Tk() window.title( 'Calculator' ) window.geometry( "300x200" ) entry = Entry(window,text = "Enter data" ) button = Button(window,text = "Click me" ) mainloop() |
This poses another question: How am i even suppose to know what parameters Entry accepts if while typing the code in PyCharm, hint is pretty much useless and gives no examples nor lists accepted parameters ?
Thanks !