This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import math | |
| import tkinter as tk | |
| import numpy as np | |
| import matplotlib.pyplot | |
| from tkinter import ttk, INSERT | |
| from tkinter.messagebox import showerror, showwarning, showinfo | |
| from tkinter import filedialog | |
| matplotlib.use('TkAgg')#задает использование бэкенда TkAgg для визуализации графиков matplotlib в приложении tkinter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| import matplotlib.pyplot as plt | |
| from tkinter import * | |
| from tkinter.messagebox import showerror, showinfo | |
| import numpy as np | |
| from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
| from matplotlib.figure import Figure | |
| from matplotlib.backends.backend_tkagg import NavigationToolbar2Tk | |
| from tkinter import filedialog as fd, filedialog, messagebox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| class Pendulum:# описывает уравнение движения маятника | |
| def __init__(self, attenuation, amplitude, outfrequency): #инициализирует параметры маятника | |
| self.amplitude = amplitude | |
| self.attenuation = attenuation#затуханиe | |
| self.outfrequency = outfrequency#частота вынуждающей силы | |
| def __call__(self, Y, t):#вычисляет производные угла и угловой скорости маятника по заданному состоянию и времени |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter as tk | |
| import matplotlib.pyplot as plt | |
| from tkinter import * | |
| from tkinter.messagebox import showerror, showinfo | |
| from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
| from matplotlib.figure import Figure | |
| from math import * | |
| from matplotlib.backends.backend_tkagg import NavigationToolbar2Tk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from tkinter.messagebox import showerror | |
| import matplotlib.pyplot as plt | |
| from math import * | |
| from numpy.f2py.auxfuncs import options | |
| class matrix2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tkinter import* | |
| def label_entry(parent, label_text):#функция создает виджеты (Label)и(Entry) внутри родительского виджета (parent) | |
| frame = Frame(parent)#Создается фрейм (Frame) внутри родительского виджета. Фрейм используется для группировки других виджетов вместе | |
| label = Label(frame, text=label_text)#Создается метка (Label) с указанным текстом (label_text) внутри фрейма. | |
| entry = Entry(frame) | |
| label.pack(side=LEFT)#Упаковываются виджеты метки и текстового поля внутри фрейма с использованием методов `pack() | |
| entry.pack(side=LEFT) | |
| return frame |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| #позволяет открывать файлы с различными режимами доступа, например,для чтения или для записи | |
| import io | |
| def enter_int():# define function | |
| while True: | |
| try: | |
| x = int(input("Please enter integer number: ")) | |
| break | |
| except ValueError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import matplotlib.pyplot as plt #Пример подключение модуля: | |
| import math | |
| def get_float_input(prompt="Введите число: "): | |
| while True: | |
| try: | |
| num = float(input(prompt)) | |
| return num | |
| except ValueError: | |
| print("Ошибка ввода! Пожалуйста, введите вещественное число.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 2 3 4 | |
| 2 4 6 8 | |
| 3 6 9 12 | |
| 4 8 12 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| #позволяет открывать файлы с различными режимами доступа, например,для чтения или для записи | |
| import io | |
| def enter_int():# define function | |
| while True: | |
| try: | |
| x = int(input("Please enter integer number: ")) | |
| break | |
| except ValueError: |