3

I am using thonny now but I wanted to know in general that can I comment in between a line of code in python

from tkinter import *
root=Tk()

mybutton=Button(root,text="click Help",state=DISABLED,padx=60,pady=55) 
mybutton.pack()
root.mainloop()                                                                                    

I wanted to comment state=disabled here but not the entire line. So can I do it or I have to write a new line for it. :)

0

1 Answer 1

2

You can put the arguments on multiple lines, then comment the one you don't want:

from tkinter import *
root=Tk()

mybutton = Button(
    root,
    text="click Help",
    #state=DISABLED,
    padx=60,
    pady=55
) 
mybutton.pack()
root.mainloop()                                                                                    

Not the answer you're looking for? Browse other questions tagged or ask your own question.