MamakinYR 5 дней назад
Родитель d5a6b8ebd1
Сommit 84755ea1b2

@ -1,524 +1,262 @@
\# Отчет по теме 8
# Отчет по теме 8
Мамакин Ярослав, А-02-23
\## 1 Начало работы со средой и подключение необходимых модулей
## 1 Начало работы со средой и подключение необходимых модулей
```py
>>> import os,sys,importlib
>>> os.chdir(r'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8')
>>> os.chdir(r'C:\Users\uprkt\Desktop\ПО\python-labs\TEMA8')
>>> os.getcwd()
'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8'
'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8'
```
## 2 Создание и использование модулей в среде Python.
\## 2 Создание и использование модулей в среде Python.
\## 2.1 Запуск модуля на выполнение путем его импорта.
## 2.1 Запуск модуля на выполнение путем его импорта.
```py
>>> import Mod1
Mod1:Введите значение = 5
Mod1:Значение perm1= 5
>>> Mod1.perm1
'5'
>>> import Mod1
>>> importlib.reload(Mod1)
Mod1:Введите значение = 3
Mod1:Значение perm1= 3
<module 'Mod1' from 'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8\\\\Mod1.py'>
<module 'Mod1' from 'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod1.py'>
>>> Mod1.perm1
'3'
```
\## 2.2 Словарь импортированных модулей
## 2.2 Словарь импортированных модулей
```py
>>> print(sorted(sys.modules.keys()))
\\\['Mod1', '\\\_\\\_future\\\_\\\_', '\\\_\\\_main\\\_\\\_', '\\\_abc', '\\\_ast', '\\\_bisect', '\\\_bz2', '\\\_codecs', '\\\_collections', '\\\_collections\\\_abc', '\\\_colorize', '\\\_compat\\\_pickle', '\\\_compression', '\\\_datetime', '\\\_frozen\\\_importlib', '\\\_frozen\\\_importlib\\\_external', '\\\_functools', '\\\_heapq', '\\\_imp', '\\\_io', '\\\_lzma', '\\\_opcode', '\\\_opcode\\\_metadata', '\\\_operator', '\\\_pickle', '\\\_pyrepl', '\\\_pyrepl.pager', '\\\_queue', '\\\_random', '\\\_signal', '\\\_sitebuiltins', '\\\_socket', '\\\_sre', '\\\_stat', '\\\_string', '\\\_struct', '\\\_sysconfig', '\\\_thread', '\\\_tkinter', '\\\_tokenize', '\\\_typing', '\\\_warnings', '\\\_weakref', '\\\_weakrefset', '\\\_winapi', '\\\_wmi', 'abc', 'ast', 'bdb', 'binascii', 'bisect', 'builtins', 'bz2', 'codecs', 'collections', 'collections.abc', 'configparser', 'contextlib', 'copyreg', 'datetime', 'dis', 'encodings', 'encodings.aliases', 'encodings.cp1251', 'encodings.utf\\\_8', 'enum', 'errno', 'fnmatch', 'functools', 'genericpath', 'heapq', 'idlelib', 'idlelib.autocomplete', 'idlelib.autocomplete\\\_w', 'idlelib.calltip', 'idlelib.calltip\\\_w', 'idlelib.config', 'idlelib.debugger', 'idlelib.debugger\\\_r', 'idlelib.debugobj', 'idlelib.debugobj\\\_r', 'idlelib.hyperparser', 'idlelib.iomenu', 'idlelib.macosx', 'idlelib.multicall', 'idlelib.pyparse', 'idlelib.rpc', 'idlelib.run', 'idlelib.scrolledlist', 'idlelib.stackviewer', 'idlelib.tooltip', 'idlelib.tree', 'idlelib.util', 'idlelib.window', 'idlelib.zoomheight', 'importlib', 'importlib.\\\_abc', 'importlib.\\\_bootstrap', 'importlib.\\\_bootstrap\\\_external', 'importlib.machinery', 'importlib.util', 'inspect', 'io', 'ipaddress', 'itertools', 'keyword', 'linecache', 'lzma', 'marshal', 'math', 'nt', 'ntpath', 'opcode', 'operator', 'os', 'os.path', 'pickle', 'pkgutil', 'platform', 'plistlib', 'posixpath', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 'random', 're', 're.\\\_casefix', 're.\\\_compiler', 're.\\\_constants', 're.\\\_parser', 'reprlib', 'select', 'selectors', 'shlex', 'shutil', 'site', 'socket', 'socketserver', 'stat', 'string', 'struct', 'sys', 'sysconfig', 'tempfile', 'textwrap', 'threading', 'time', 'tkinter', 'tkinter.constants', 'token', 'tokenize', 'traceback', 'types', 'typing', 'urllib', 'urllib.parse', 'warnings', 'weakref', 'winreg', 'xml', 'xml.parsers', 'xml.parsers.expat', 'xml.parsers.expat.errors', 'xml.parsers.expat.model', 'zipimport', 'zlib']
\['Mod1', '\_\_future\_\_', '\_\_main\_\_', '\_abc', '\_ast', '\_bisect', '\_bz2', '\_codecs', '\_collections', '\_collections\_abc', '\_colorize', '\_compat\_pickle', '\_compression', '\_datetime', '\_frozen\_importlib', '\_frozen\_importlib\_external', '\_functools', '\_heapq', '\_imp', '\_io', '\_lzma', '\_opcode', '\_opcode\_metadata', '\_operator', '\_pickle', '\_pyrepl', '\_pyrepl.pager', '\_queue', '\_random', '\_signal', '\_sitebuiltins', '\_socket', '\_sre', '\_stat', '\_string', '\_struct', '\_sysconfig', '\_thread', '\_tkinter', '\_tokenize', '\_typing', '\_warnings', '\_weakref', '\_weakrefset', '\_winapi', '\_wmi', 'abc', 'ast', 'bdb', 'binascii', 'bisect', 'builtins', 'bz2', 'codecs', 'collections', 'collections.abc', 'configparser', 'contextlib', 'copyreg', 'datetime', 'dis', 'encodings', 'encodings.aliases', 'encodings.cp1251', 'encodings.utf\_8', 'enum', 'errno', 'fnmatch', 'functools', 'genericpath', 'heapq', 'idlelib', 'idlelib.autocomplete', 'idlelib.autocomplete\_w', 'idlelib.calltip', 'idlelib.calltip\_w', 'idlelib.config', 'idlelib.debugger', 'idlelib.debugger\_r', 'idlelib.debugobj', 'idlelib.debugobj\_r', 'idlelib.hyperparser', 'idlelib.iomenu', 'idlelib.macosx', 'idlelib.multicall', 'idlelib.pyparse', 'idlelib.rpc', 'idlelib.run', 'idlelib.scrolledlist', 'idlelib.stackviewer', 'idlelib.tooltip', 'idlelib.tree', 'idlelib.util', 'idlelib.window', 'idlelib.zoomheight', 'importlib', 'importlib.\_abc', 'importlib.\_bootstrap', 'importlib.\_bootstrap\_external', 'importlib.machinery', 'importlib.util', 'inspect', 'io', 'ipaddress', 'itertools', 'keyword', 'linecache', 'lzma', 'marshal', 'math', 'nt', 'ntpath', 'opcode', 'operator', 'os', 'os.path', 'pickle', 'pkgutil', 'platform', 'plistlib', 'posixpath', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 'random', 're', 're.\_casefix', 're.\_compiler', 're.\_constants', 're.\_parser', 'reprlib', 'select', 'selectors', 'shlex', 'shutil', 'site', 'socket', 'socketserver', 'stat', 'string', 'struct', 'sys', 'sysconfig', 'tempfile', 'textwrap', 'threading', 'time', 'tkinter', 'tkinter.constants', 'token', 'tokenize', 'traceback', 'types', 'typing', 'urllib', 'urllib.parse', 'warnings', 'weakref', 'winreg', 'xml', 'xml.parsers', 'xml.parsers.expat', 'xml.parsers.expat.errors', 'xml.parsers.expat.model', 'zipimport', 'zlib']
>>> sys.modules.pop('Mod1')
<module 'Mod1' from 'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8\\\\Mod1.py'>
<module 'Mod1' from 'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod1.py'>
>>> print(sorted(sys.modules.keys()))
\\\['\\\_\\\_future\\\_\\\_', '\\\_\\\_main\\\_\\\_', '\\\_abc', '\\\_ast', '\\\_bisect', '\\\_bz2', '\\\_codecs', '\\\_collections', '\\\_collections\\\_abc', '\\\_colorize', '\\\_compat\\\_pickle', '\\\_compression', '\\\_datetime', '\\\_frozen\\\_importlib', '\\\_frozen\\\_importlib\\\_external', '\\\_functools', '\\\_heapq', '\\\_imp', '\\\_io', '\\\_lzma', '\\\_opcode', '\\\_opcode\\\_metadata', '\\\_operator', '\\\_pickle', '\\\_pyrepl', '\\\_pyrepl.pager', '\\\_queue', '\\\_random', '\\\_signal', '\\\_sitebuiltins', '\\\_socket', '\\\_sre', '\\\_stat', '\\\_string', '\\\_struct', '\\\_sysconfig', '\\\_thread', '\\\_tkinter', '\\\_tokenize', '\\\_typing', '\\\_warnings', '\\\_weakref', '\\\_weakrefset', '\\\_winapi', '\\\_wmi', 'abc', 'ast', 'bdb', 'binascii', 'bisect', 'builtins', 'bz2', 'codecs', 'collections', 'collections.abc', 'configparser', 'contextlib', 'copyreg', 'datetime', 'dis', 'encodings', 'encodings.aliases', 'encodings.cp1251', 'encodings.utf\\\_8', 'enum', 'errno', 'fnmatch', 'functools', 'genericpath', 'heapq', 'idlelib', 'idlelib.autocomplete', 'idlelib.autocomplete\\\_w', 'idlelib.calltip', 'idlelib.calltip\\\_w', 'idlelib.config', 'idlelib.debugger', 'idlelib.debugger\\\_r', 'idlelib.debugobj', 'idlelib.debugobj\\\_r', 'idlelib.hyperparser', 'idlelib.iomenu', 'idlelib.macosx', 'idlelib.multicall', 'idlelib.pyparse', 'idlelib.rpc', 'idlelib.run', 'idlelib.scrolledlist', 'idlelib.stackviewer', 'idlelib.tooltip', 'idlelib.tree', 'idlelib.util', 'idlelib.window', 'idlelib.zoomheight', 'importlib', 'importlib.\\\_abc', 'importlib.\\\_bootstrap', 'importlib.\\\_bootstrap\\\_external', 'importlib.machinery', 'importlib.util', 'inspect', 'io', 'ipaddress', 'itertools', 'keyword', 'linecache', 'lzma', 'marshal', 'math', 'nt', 'ntpath', 'opcode', 'operator', 'os', 'os.path', 'pickle', 'pkgutil', 'platform', 'plistlib', 'posixpath', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 'random', 're', 're.\\\_casefix', 're.\\\_compiler', 're.\\\_constants', 're.\\\_parser', 'reprlib', 'select', 'selectors', 'shlex', 'shutil', 'site', 'socket', 'socketserver', 'stat', 'string', 'struct', 'sys', 'sysconfig', 'tempfile', 'textwrap', 'threading', 'time', 'tkinter', 'tkinter.constants', 'token', 'tokenize', 'traceback', 'types', 'typing', 'urllib', 'urllib.parse', 'warnings', 'weakref', 'winreg', 'xml', 'xml.parsers', 'xml.parsers.expat', 'xml.parsers.expat.errors', 'xml.parsers.expat.model', 'zipimport', 'zlib']
\['\_\_future\_\_', '\_\_main\_\_', '\_abc', '\_ast', '\_bisect', '\_bz2', '\_codecs', '\_collections', '\_collections\_abc', '\_colorize', '\_compat\_pickle', '\_compression', '\_datetime', '\_frozen\_importlib', '\_frozen\_importlib\_external', '\_functools', '\_heapq', '\_imp', '\_io', '\_lzma', '\_opcode', '\_opcode\_metadata', '\_operator', '\_pickle', '\_pyrepl', '\_pyrepl.pager', '\_queue', '\_random', '\_signal', '\_sitebuiltins', '\_socket', '\_sre', '\_stat', '\_string', '\_struct', '\_sysconfig', '\_thread', '\_tkinter', '\_tokenize', '\_typing', '\_warnings', '\_weakref', '\_weakrefset', '\_winapi', '\_wmi', 'abc', 'ast', 'bdb', 'binascii', 'bisect', 'builtins', 'bz2', 'codecs', 'collections', 'collections.abc', 'configparser', 'contextlib', 'copyreg', 'datetime', 'dis', 'encodings', 'encodings.aliases', 'encodings.cp1251', 'encodings.utf\_8', 'enum', 'errno', 'fnmatch', 'functools', 'genericpath', 'heapq', 'idlelib', 'idlelib.autocomplete', 'idlelib.autocomplete\_w', 'idlelib.calltip', 'idlelib.calltip\_w', 'idlelib.config', 'idlelib.debugger', 'idlelib.debugger\_r', 'idlelib.debugobj', 'idlelib.debugobj\_r', 'idlelib.hyperparser', 'idlelib.iomenu', 'idlelib.macosx', 'idlelib.multicall', 'idlelib.pyparse', 'idlelib.rpc', 'idlelib.run', 'idlelib.scrolledlist', 'idlelib.stackviewer', 'idlelib.tooltip', 'idlelib.tree', 'idlelib.util', 'idlelib.window', 'idlelib.zoomheight', 'importlib', 'importlib.\_abc', 'importlib.\_bootstrap', 'importlib.\_bootstrap\_external', 'importlib.machinery', 'importlib.util', 'inspect', 'io', 'ipaddress', 'itertools', 'keyword', 'linecache', 'lzma', 'marshal', 'math', 'nt', 'ntpath', 'opcode', 'operator', 'os', 'os.path', 'pickle', 'pkgutil', 'platform', 'plistlib', 'posixpath', 'pydoc', 'pyexpat', 'pyexpat.errors', 'pyexpat.model', 'queue', 'random', 're', 're.\_casefix', 're.\_compiler', 're.\_constants', 're.\_parser', 'reprlib', 'select', 'selectors', 'shlex', 'shutil', 'site', 'socket', 'socketserver', 'stat', 'string', 'struct', 'sys', 'sysconfig', 'tempfile', 'textwrap', 'threading', 'time', 'tkinter', 'tkinter.constants', 'token', 'tokenize', 'traceback', 'types', 'typing', 'urllib', 'urllib.parse', 'warnings', 'weakref', 'winreg', 'xml', 'xml.parsers', 'xml.parsers.expat', 'xml.parsers.expat.errors', 'xml.parsers.expat.model', 'zipimport', 'zlib']
import Mod1
Mod1:Введите значение = 2
Mod1:Значение perm1= 2
Mod1.perm1
'2'
sys.modules.pop('Mod1')
<module 'Mod1' from 'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8\\\\Mod1.py'>
<module 'Mod1' from 'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod1.py'>
```
\## 2.3 Запуск модуля на выполнение с помощью функции exec()
## 2.3 Запуск модуля на выполнение с помощью функции exec()
```py
>>> exec(open('Mod1.py').read())
Mod1:Введите значение = 6
Mod1:Значение perm1= 6
>>> Mod1.perm1
'2'
>>> perm1
'6'
>>> exec(open('Mod1.py').read())
Mod1:Введите значение = 7
Mod1:Значение perm1= 7
>>> perm1
'7'
>>> exec(open('Mod1.py').read())
Mod1:Введите значение = 8
Mod1:Значение perm1= 8
>>> perm1
'8'
```
\## 2.4
## 2.4
```py
>>> from Mod1 import perm1
Mod1:Введите значение = 9
Mod1:Значение perm1= 9
>>> perm1
'9'
>>> dir()
\\\['Mod1', '\\\_\\\_annotations\\\_\\\_', '\\\_\\\_builtins\\\_\\\_', '\\\_\\\_doc\\\_\\\_', '\\\_\\\_loader\\\_\\\_', '\\\_\\\_name\\\_\\\_', '\\\_\\\_package\\\_\\\_', '\\\_\\\_spec\\\_\\\_', '\\\_\\\_warningregistry\\\_\\\_', 'importlib', 'os', 'perm1', 'sys']
\['Mod1', '\_\_annotations\_\_', '\_\_builtins\_\_', '\_\_doc\_\_', '\_\_loader\_\_', '\_\_name\_\_', '\_\_package\_\_', '\_\_spec\_\_', '\_\_warningregistry\_\_', 'importlib', 'os', 'perm1', 'sys']
>>> from Mod2 import beta
>>> g=beta(2)
>>> g
535.4916555247646
>>> dir()
\\\['Mod1', '\\\_\\\_annotations\\\_\\\_', '\\\_\\\_builtins\\\_\\\_', '\\\_\\\_doc\\\_\\\_', '\\\_\\\_loader\\\_\\\_', '\\\_\\\_name\\\_\\\_', '\\\_\\\_package\\\_\\\_', '\\\_\\\_spec\\\_\\\_', '\\\_\\\_warningregistry\\\_\\\_', 'beta', 'g', 'importlib', 'os', 'perm1', 'sys']
\['Mod1', '\_\_annotations\_\_', '\_\_builtins\_\_', '\_\_doc\_\_', '\_\_loader\_\_', '\_\_name\_\_', '\_\_package\_\_', '\_\_spec\_\_', '\_\_warningregistry\_\_', 'beta', 'g', 'importlib', 'os', 'perm1', 'sys']
>>> alpha()
Traceback (most recent call last):
File "<pyshell#30>", line 1, in <module>
alpha()
NameError: name 'alpha' is not defined
>>> from Mod2 import alpha as al
>>> al()
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=5
'5'
>>> del al,beta
>>> from Mod2 import alpha as al, beta as bt
>>> del al,bt
>>> from Mod2 import \*
>>> from Mod2 import *
>>> tt=alpha()
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=0.12
>>> uu=beta(float(tt))
>>> uu
1.4578913609506803
```
## 3 Создание многомодульных программ
\## 3 Создание многомодульных программ
\## 3.1 Пример простой многомодульной программы
## 3.1 Пример простой многомодульной программы
```py
>>> sys.modules.pop('Mod1')
<module 'Mod1' from 'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8\\\\Mod1.py'>
<module 'Mod1' from 'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod1.py'>
>>> sys.modules.pop('Mod2')
<module 'Mod2' from 'C:\\\\Users\\\\uprkt\\\\Desktop\\\\ПО\\\\python-labs\\\\TEMA8\\\\Mod2.py'>
<module 'Mod2' from 'C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod2.py'>
>>> import Mod0
Mod1:Введите значение = 7
Mod1:Значение perm1= 7
perm1= 7
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=8
tt= 8
qq= 82226315585.59491
>>> Mod0.tt;Mod0.qq;Mod0.Mod1.perm1
'8'
82226315585.59491
'7'
```
\## 3.2 Пример 2
## 3.2 Пример 2
Модуль ММ2:
```py
znach=input('k1,T,k2,Xm,A,F,N=').split(',')
k1=float(znach\[0])
T=float(znach\[1])
k2=float(znach\[2])
Xm=float(znach\[3])
A=float(znach\[4])
F=float(znach\[5])
N=int(znach\[6])
k1=float(znach[0])
T=float(znach[1])
k2=float(znach[2])
Xm=float(znach[3])
A=float(znach[4])
F=float(znach[5])
N=int(znach[6])
import math
vhod=\[]
vhod=[]
for i in range(N):
&nbsp; vhod.append(A\*math.sin((2\*i\*math.pi)\*F))
vhod.append(A*math.sin((2*i*math.pi)*F))
import MM1 as mod
yi1=0;yin1=0;yi2=0
vyhod=\[]
vyhod=[]
for xt in vhod:
&nbsp; xt1=xt-yi2 #отрицательная обратная связь
&nbsp; \[yi1,yin1]=mod.realdvig(xt1,k1,T,yi1,yin1)
&nbsp; yi2=mod.tahogen(yin1,k2,yi2)
&nbsp; yt=mod.nechus(yin1,Xm)
&nbsp; vyhod.append(yt)
xt1=xt-yi2 #отрицательная обратная связь
[yi1,yin1]=mod.realdvig(xt1,k1,T,yi1,yin1)
yi2=mod.tahogen(yin1,k2,yi2)
yt=mod.nechus(yin1,Xm)
vyhod.append(yt)
```
Модуль MM0:
```py
import MM2
print('y=',MM2.vyhod)
```
Запустим модуль MM0:
```py
&nbsp;import MM0
import MM0
k1,T,k2,Xm,A,F,N=2,10,3,1,5,0.025,30
y= \[0, 0, 0, 0, 0, 0, 0, -1.299465163446989, -1.3579959054305797, 0, 3.7144096317728987, 7.811411673609909, 6.5646766889828605, -1.7207792337901524, -18.81372872718616, -31.38046599103643, -22.278866622819873, 17.097152611947436, 77.81058529582174, 112.97718138176809, 62.60779574768801, -98.35894773519156, -309.62984734263415, -395.51094806311954, -151.2442551724449, 474.0906424325323, 1190.4363664389593, 1337.7521059074418, 237.48484712636358, -2125.064719245332]
y= [0, 0, 0, 0, 0, 0, 0, -1.299465163446989, -1.3579959054305797, 0, 3.7144096317728987, 7.811411673609909, 6.5646766889828605, -1.7207792337901524, -18.81372872718616, -31.38046599103643, -22.278866622819873, 17.097152611947436, 77.81058529582174, 112.97718138176809, 62.60779574768801, -98.35894773519156, -309.62984734263415, -395.51094806311954, -151.2442551724449, 474.0906424325323, 1190.4363664389593, 1337.7521059074418, 237.48484712636358, -2125.064719245332]
```
\## 3.3 Области действия объектов в модулях
## 3.3 Области действия объектов в модулях
```py
def alpha():
&nbsp; print('\*\*\*\*ALPHA\*\*\*\*')
&nbsp; t=input('Значение t=')
&nbsp; beta(float(t))
&nbsp; return t
&nbsp;
print('****ALPHA****')
t=input('Значение t=')
beta(float(t))
return t
def beta(q):
&nbsp; import math
&nbsp; expi=q\*math.pi
&nbsp; alpha()
&nbsp; return math.exp(expi)
import math
expi=q*math.pi
alpha()
return math.exp(expi)
```
```py
>>> Mod2.alpha()
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=9
'9'
>>> Mod2.beta(8)
82226315585.59491
```
```py
\#Модуль Mod0
#Модуль Mod0
import Mod1
print('perm1=',Mod1.perm1)
from Mod2 import alpha as al
tt=al()
print('tt=',tt)
from Mod2 import beta
qq=beta(float(tt))
print('qq=',qq)
print('t=',t)
print('expi=',expi)
```
```py
>>> import Mod0
perm1= 9
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=1
tt= 1
qq= 23.140692632779267
Traceback (most recent call last):
&nbsp; File "<pyshell#12>", line 1, in <module>
&nbsp; import Mod0
&nbsp; File "C:\\Users\\uprkt\\Desktop\\ПО\\python-labs\\TEMA8\\Mod0.py", line 10, in <module>
&nbsp; print('t=',t)
File "<pyshell#12>", line 1, in <module>
import Mod0
File "C:\Users\uprkt\Desktop\ПО\python-labs\TEMA8\Mod0.py", line 10, in <module>
print('t=',t)
NameError: name 't' is not defined. Did you mean: 'tt'?
```
```py
\#Модуль Mod0
#Модуль Mod0
import Mod1
Mod1.perm1=1337
print('perm1=',Mod1.perm1)
from Mod2 import alpha as al
tt=al()
print('tt=',tt)
from Mod2 import beta
qq=beta(float(tt))
print('qq=',qq)
```
```py
>>> import Mod0
perm1= 1337
\*\*\*\*ALPHA\*\*\*\*
****ALPHA****
Значение t=8
tt= 8
qq= 82226315585.59491
```
```py
>>> Mod0.Mod1.perm1=4
>>> Mod0.Mod1.perm1
4
>>> Mod0.Mod1.tt=10
>>> Mod0.Mod1.qq=93865
>>> Mod0.Mod1.tt
10
>>> Mod0.Mod1.qq
93865
```
```
Загрузка…
Отмена
Сохранить