곱셈 연산 본문

[PL]/Python

곱셈 연산

객과 함께. 2007. 8. 27. 00:41
#!/usr/bin/wish
proc LessTrouble {args} {
	set b 0
	label .label -textvariable x
	set f [frame .buttons -borderwidth 10]
	foreach val $args {
		button $f.$b -text $val \-> 표시는 계속해서 이어진다는 것을 알려준다.
		      -command "UpdateX $val"
		pack $f.$b -side left
		incr b
	}
	pack .label $f
}
proc UpdateX {val} {
	global x
	set x [expr $x * $val]
}
set x 1
LessTrouble -1 4 7 36

그래픽 예제 프로그램 입니다.


'[PL] > Python' 카테고리의 다른 글

PIL 모듈을이용하여 이미지 처리  (0) 2007.09.17
연산 예제 프로그램  (0) 2007.08.27
사전 예제 프로그램  (0) 2007.08.27
짝홀수  (0) 2007.08.24
사칙 연산  (0) 2007.08.19