Вопрос задан 15.06.2023 в 00:47. Предмет Информатика. Спрашивает Мирная Карина.

Рівень 2-3 (3-9 балів) Створити вікно з характеристиками на Ваш вибір. Створити три різних кнопки

з назвами «Принтер», «Сканер», «Клавіатура».I вiдповiдно три написи з характеристиками пристроїв ПК.Умова - щоб при натисненні на кнопку з'являвся відповідний напис.​
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Фугаев Рома.

import tkinter as tk

root = tk.Tk()

root.geometry("1000x600")

lb1 = tk.Label(master = root, text = "above 3000 piece of papers!")

lb2 = tk.Label(master = root, text = "above 4000px per sm!")

lb3 = tk.Label(master = root, text = "100 butons)")

btt1 = tk.Button(master=root, text="Принтер", command=lambda: lb1.pack()).pack()

btt2 = tk.Button(master=root, text="Сканер", command=lambda: lb2.pack()).pack()

btt3 = tk.Button(master=root, text="Клавіатура", command=lambda: lb3.pack()).pack()

root.mainloop()

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

To create a window with characteristics and three different buttons named "Printer," "Scanner," and "Keyboard," along with corresponding labels for the PC devices, you can use a graphical user interface (GUI) library like Tkinter in Python. Here's an example of how you can achieve this:

```python import tkinter as tk

def show_printer(): label.config(text="Printer: [characteristics]")

def show_scanner(): label.config(text="Scanner: [characteristics]")

def show_keyboard(): label.config(text="Keyboard: [characteristics]")

# Create the main window window = tk.Tk()

# Create the label to display the characteristics label = tk.Label(window, text="Click a button to see the device characteristics") label.pack()

# Create the buttons printer_button = tk.Button(window, text="Printer", command=show_printer) printer_button.pack()

scanner_button = tk.Button(window, text="Scanner", command=show_scanner) scanner_button.pack()

keyboard_button = tk.Button(window, text="Keyboard", command=show_keyboard) keyboard_button.pack()

# Start the main event loop window.mainloop() ```

In this example, we import the `tkinter` module and define three functions (`show_printer()`, `show_scanner()`, and `show_keyboard()`) that will be called when the corresponding button is clicked. Each function updates the label's text with the characteristics of the respective device.

We then create the main window using `tk.Tk()`, create a label to display the characteristics, and pack it into the window. Next, we create the three buttons, specifying their text and the corresponding function to call when clicked. Finally, we start the main event loop using `window.mainloop()` to handle user interactions.

When you run this code, a window will appear with the label "Click a button to see the device characteristics" and three buttons labeled "Printer," "Scanner," and "Keyboard." When you click any of the buttons, the label will update with the corresponding device's characteristics.

Please note that this example assumes you have Python and the Tkinter library installed on your system. If you don't have them installed, you can refer to the official Python documentation or relevant online resources for installation instructions.

I hope this helps! Let me know if you have any further questions.

0 0

Похожие вопросы

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос