Python£ºÇë½ÌTkÖÐradiobutton¿Ø¼þµÄÁ½¸öÊôÐÔ×÷ÓÃ
ÇëÏÈ¿´ÏÂÃæµÄ¼òµ¥´úÂ룺
Python code:
from tkinter import *
root = Tk()
v = IntVar()
v.set(0)
for i in range(3):
Radiobutton(root,
variable = v,
value = i).pack()
root.mainloop()
ÎÊÌ⣺
1¡¢Radiobutton¿Õ¼äÖеÄvariableÊôÐÔºÍvalueÊôÐÔ·Ö±ðÆðµ½Ê²Ã´×÷Óã¿
2¡¢variableΪʲô¸³ÖµÎªv£¬È»ºó¸øv¸³ÖµÎª0£¬¿ÉÒÔÕý³£¹¤×÷£¬µ«ÊÇÈç¹ûÖ±½Ó¸øvariable¸³ÖµÎª0£¬¾Í²»ÐÐÁËÄØ£¿
лл£¡
value Ö¸¶¨µÄÊÇ RadioButton ¹ØÁªµÄÖµ
Python code:
Command-Line Name: -value
Database Name: value
Database Class: Value
Specifies value to store in the button's associated variable whenever
this button is selected.
variable Ö¸¶¨µÄÊÇ RadioButton Ñ¡ÖÐʱÉèÖõıäÁ¿Ãû£¬Õâ¸ö±ØÐëÊÇÈ«¾ÖµÄ±äÁ¿Ãû£¬Óà 0 ¿Ï¶¨ÊDz»ÐеÄ
Python code:
Command-Line Name: -variable
Database Name: variable
Database Class: Variable
Specifies name of global variable to set whenever this button is selected.
Changes in this variable also cause the button to select or deselect itself.
Defaults to the value selectedButton.
ллÄãµÄÖ¸½Ì£¬²»
Ïà¹ØÎÊ´ð£º
pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁ³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿
Çó´ó¼ÒÖ¸½Ì
ûÓÐÈËÓà ......
ÔÚlistÖÐÌí¼ÓÒ»¸öÀàµÄ¾Ö²¿±äÁ¿ ÕâÑù×öÊÇ·ñºÏ·¨ Çë¿´ÏÂÃæÀý×Ó:
Python code:
class A():
def __init__( self ):
self.__a = 0
self.__b = 'hello'
def get_a( self ):
ret ......
RowNum=18
ColumnNum=10
SquareList=[[0 for a in range(ColumnNum)] for b in range(RowNum)]
ActiveList=[[0 for a in range(ColumnNum)] for b in range(RowNum)]
ActiveList[0][5]=1
SquareL ......
È磺
def aa(i):
print i
a=[1,2,3]
b=2
c=3
ÄÜʶ±ð³öÆðʼλdef aa(i):
ºÍ½áÊøλ" a=[1,2,3]"£¿
ÏñPython¶ÔÓï·¨ÕâôҪÇóÑϸñµÄÎÒ¾õµÃ¾Í²»ÒªÓÃÕýÔòÁË£¬Ð§Âʲ»¸ß¡£Ö±½ÓÓÃÅжϾͿÉÒÔÁË£¬Î ......
ÒÔÏ´úÂëÊÇTk×öÁËÒ»¸ö¼òµ¥µÄÃÜÂëÑéÖ¤¹¦ÄÜ£¬ÊäÈëÒ»¸ö×Ö·û´®£¬²¢ÑéÖ¤ÆäÊÇ·ñÕýÈ·£¬ÇëÏÈ¿´´úÂ룺
Python code:
from tkinter import *
root = Tk()
e = StringVar()
t = 'cashlu'
def yanzheng():
if e ......