Pyton misollar to'plami - 2.zip
283.3 KB
Python misollar to'plami - 2
Python misollar to'plami -3.zip
36.3 KB
Python misollar to'plami -3
python-3.9.0a3.exe
25.4 MB
PYTHON O'rnatib oling Python 3.9 versiyasi. Ushbu dastur oxirgi versiyasi bo'lib, tarkibida matn muharriri va terminal mavjud.
[Prohorenok-N.A.]-Python.-Samoe-neobhodimoe(z-lib.org).pdf
9 MB
PYTHON tilini o'rganishda eng qulay bo'lgan qo'llanma!!!
8класс_Python.pdf
10.6 MB
PYTHON maktab o'quvchilari uchun darsliklar
9класс_Python.pdf
12.4 MB
PYTHON maktab o'quvchilari uchun darsliklar
10-8Python-I.pdf
11.3 MB
PYTHON maktab o'quvchilari uchun darsliklar
10-8Python-II.pdf
12 MB
PYTHON maktab o'quvchilari uchun darsliklar
11-6_Python.pdf
15 MB
PYTHON maktab o'quvchilari uchun darsliklar
11-7_Python.pdf
17.3 MB
PYTHON maktab o'quvchilari uchun darsliklar
Графика_Python.pdf
12.1 MB
PYTHON maktab o'quvchilari uchun darsliklar
from simpletk import *
from int_edit import TIntEdit
app = TApplication("Калькулятор")
app.size = (160, 192)
x1 = 0
x2 = 0
oper = None
nextNumber = False
f = ("Courier New", 12)
disp = TIntEdit(app, width=14, font=f)
disp.position = (8, 8)
b = ['7', '8', '9', 'C',
'4', '5', '6', '/',
'1', '2', '3', '*',
'0', '=', '+', '-']
btn = []
for r in range(4):
for c in range(4):
k = 4*r + c
btn.append(TButton(app, text=b[k], font=f, width=2))
btn[k].position = (8+38*c, 40+38*r)
btn[3]["fg"] = "red"
def doClear ( sender ):
global nextNumber
disp.text = ""
print('cl>', disp.text)
nextNumber = False
def doCalc ( sender ):
global nextNumber, oper, x1, x2
if not oper: return
x2 = disp.value
if oper == "+": res = x1 + x2
elif oper == "-": res = x1 - x2
elif oper == "*": res = x1 * x2
elif oper == "/": res = x1 // x2
disp.text = str(res)
nextNumber = True
def doOperation ( sender ):
global nextNumber, oper, x1
x1 = disp.value
oper = sender["text"]
nextNumber = True
def doDigit ( sender ):
global nextNumber
if nextNumber:
disp.text = ""
nextNumber = False
disp.text = disp.text + sender["text"]
for k in [0, 1, 2,
4, 5, 6,
8, 9, 10,
12]:
btn[k].onClick = doDigit
for k in [7, 11, 14, 15]:
btn[k].onClick = doOperation
btn[13].onClick = doCalc
btn[3].onClick = doClear
app.Run()
from int_edit import TIntEdit
app = TApplication("Калькулятор")
app.size = (160, 192)
x1 = 0
x2 = 0
oper = None
nextNumber = False
f = ("Courier New", 12)
disp = TIntEdit(app, width=14, font=f)
disp.position = (8, 8)
b = ['7', '8', '9', 'C',
'4', '5', '6', '/',
'1', '2', '3', '*',
'0', '=', '+', '-']
btn = []
for r in range(4):
for c in range(4):
k = 4*r + c
btn.append(TButton(app, text=b[k], font=f, width=2))
btn[k].position = (8+38*c, 40+38*r)
btn[3]["fg"] = "red"
def doClear ( sender ):
global nextNumber
disp.text = ""
print('cl>', disp.text)
nextNumber = False
def doCalc ( sender ):
global nextNumber, oper, x1, x2
if not oper: return
x2 = disp.value
if oper == "+": res = x1 + x2
elif oper == "-": res = x1 - x2
elif oper == "*": res = x1 * x2
elif oper == "/": res = x1 // x2
disp.text = str(res)
nextNumber = True
def doOperation ( sender ):
global nextNumber, oper, x1
x1 = disp.value
oper = sender["text"]
nextNumber = True
def doDigit ( sender ):
global nextNumber
if nextNumber:
disp.text = ""
nextNumber = False
disp.text = disp.text + sender["text"]
for k in [0, 1, 2,
4, 5, 6,
8, 9, 10,
12]:
btn[k].onClick = doDigit
for k in [7, 11, 14, 15]:
btn[k].onClick = doOperation
btn[13].onClick = doCalc
btn[3].onClick = doClear
app.Run()
from simpletk import *
from tkinter import filedialog
app = TApplication("Просмотр рисунков")
app.position = (200, 200)
app.size = (300, 300)
panel = TPanel(app, relief="raised", height=35, bd=1)
panel.align = "top"
image = TImage(app, bg="white")
image.align = "client"
#image.picture = "flower.gif"
def selectFile(sender):
fname = filedialog.askopenfilename(
filetypes=[("Файлы GIF", "*.gif"),
("Все файлы", "*.*")] )
if fname:
image.picture = fname
openBtn = TButton(panel, width=15, text="Открыть файл")
openBtn.position = (5, 5)
openBtn.onClick = selectFile
def cbChanged(sender):
image.center = sender.checked
image.redrawImage()
centerCb = TCheckBox(panel,text="В центре")
centerCb.position = (115, 5)
centerCb.onChange = cbChanged
app.Run()
from tkinter import filedialog
app = TApplication("Просмотр рисунков")
app.position = (200, 200)
app.size = (300, 300)
panel = TPanel(app, relief="raised", height=35, bd=1)
panel.align = "top"
image = TImage(app, bg="white")
image.align = "client"
#image.picture = "flower.gif"
def selectFile(sender):
fname = filedialog.askopenfilename(
filetypes=[("Файлы GIF", "*.gif"),
("Все файлы", "*.*")] )
if fname:
image.picture = fname
openBtn = TButton(panel, width=15, text="Открыть файл")
openBtn.position = (5, 5)
openBtn.onClick = selectFile
def cbChanged(sender):
image.center = sender.checked
image.redrawImage()
centerCb = TCheckBox(panel,text="В центре")
centerCb.position = (115, 5)
centerCb.onChange = cbChanged
app.Run()