Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ode-solver-2021
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Величко Арсений Александрович
ode-solver-2021
Commits
dcbd72fc
You need to sign in or sign up before continuing.
Commit
dcbd72fc
authored
Dec 25, 2021
by
Величко Арсений Александрович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented user interface
parent
9a166934
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
main.py
src/main.py
+28
-6
No files found.
src/main.py
View file @
dcbd72fc
import
typing
as
tp
import
typer
from
tabulate
import
tabulate
import
static_solvers
import
dynamic_solvers
import
dynamic_solvers
import
functions
import
functions
import
static_solvers
from
tabulate
import
tabulate
import
typer
STATIC_METHODS
=
[
STATIC_METHODS
=
[
static_solvers
.
left_rectangle_method
,
static_solvers
.
left_rectangle_method
,
...
@@ -63,7 +60,32 @@ def main() -> None:
...
@@ -63,7 +60,32 @@ def main() -> None:
typer
.
echo
(
"Работу выполнили: Величко А.А., Галкин И.Ю., Егоров С.А., Адаев Р.М. ИВТ 2 курс
\n
"
)
typer
.
echo
(
"Работу выполнили: Величко А.А., Галкин И.Ю., Егоров С.А., Адаев Р.М. ИВТ 2 курс
\n
"
)
list_methods
()
list_methods
()
while
True
:
method_num
:
int
=
typer
.
prompt
(
"Выберите метод из списка и введите его номер"
,
type
=
int
)
if
1
<=
method_num
<=
len
(
ALL_METHODS
):
break
typer
.
echo
(
f
"Номера {method_num} нет в списке"
)
method
=
ALL_METHODS
[
method_num
-
1
]
typer
.
echo
(
f
"Выбран метод: {method.__doc__}"
)
list_functions
()
list_functions
()
while
True
:
function_num
:
int
=
typer
.
prompt
(
"Выберите функцию из списка и введите её номер"
,
type
=
int
)
if
1
<=
function_num
<=
len
(
ALL_FUNCTIONS
):
break
typer
.
echo
(
f
"Номера {function_num} нет в списке"
)
function
=
ALL_FUNCTIONS
[
function_num
-
1
]
typer
.
echo
(
f
"Выбрана функция: {function.__doc__}"
)
a
:
float
=
typer
.
prompt
(
"Нижний предел интегрирования"
,
type
=
float
)
b
:
float
=
typer
.
prompt
(
"Верхний предел интегрирования"
,
type
=
float
)
n
:
float
=
typer
.
prompt
(
"Кол-во разбиений"
,
type
=
int
)
result
:
float
=
method
(
function
,
a
,
b
,
n
)
typer
.
echo
(
f
"Результат вычислений: {result}
\n
"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment