Найти - Пользователи
Полная версия: Как скомпилировать в исполняемый файл
Начало » Python для новичков » Как скомпилировать в исполняемый файл
1 2
jigan-laym@mail.ru
py.user.next
и вывод на экран скинь сюда.
 runfile('G:/докдисс/Программы Maple/Управление для Буссинеска/4degree/WithProduct.py', wdir='G:/докдисс/Программы Maple/Управление для Буссинеска/4degree')
Traceback (most recent call last):
  File "G:\докдисс\Программы Maple\Управление для Буссинеска\4degree\WithProduct.py", line 52, in <module>
    out = list(product(lst, repeat=2))
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\products.py", line 605, in product
    prod = Product(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\products.py", line 199, in __new__
    obj = ExprWithIntLimits.__new__(cls, function, *symbols, **assumptions)
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\expr_with_limits.py", line 204, in __new__
    pre = _common_new(cls, function, *symbols,
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\expr_with_limits.py", line 64, in _common_new
    free = function.free_symbols
AttributeError: 'list' object has no attribute 'free_symbols'
и даже если
 lst = ['4', '5']
вывод тот же самый.

py.user.next
Приведи свой код в исходное состояние
Здесь

Вот перед этим участком кода
  
for i in product(anew, repeat=4):
    temp_1=eval('*'.join(i))
    XZ = XZ + integrate(temp_1, (t,0,1), (s, 0, pi))

Вставь этот код
  
import itertools
 
lst = ['-4.1054687503*sin(s)', '+0.8437499978*sin(2.*s)', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3']
 
out = list(itertools.product(lst, repeat=2))
print(out)
и вывод на экран скинь сюда.
jigan-laym@mail.ru
py.user.next
и вывод на экран скинь сюда.
Вот
 runfile('G:/докдисс/Программы Maple/Управление для Буссинеска/4degree/WithProduct.py', wdir='G:/докдисс/Программы Maple/Управление для Буссинеска/4degree')
[('-4.1054687503*sin(s)', '-4.1054687503*sin(s)'), ('-4.1054687503*sin(s)', '+0.8437499978*sin(2.*s)'), ('-4.1054687503*sin(s)', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('-4.1054687503*sin(s)', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('-4.1054687503*sin(s)', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('-4.1054687503*sin(s)', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('-4.1054687503*sin(s)', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('+0.8437499978*sin(2.*s)', '-4.1054687503*sin(s)'), ('+0.8437499978*sin(2.*s)', '+0.8437499978*sin(2.*s)'), ('+0.8437499978*sin(2.*s)', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('+0.8437499978*sin(2.*s)', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('+0.8437499978*sin(2.*s)', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('+0.8437499978*sin(2.*s)', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('+0.8437499978*sin(2.*s)', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '-4.1054687503*sin(s)'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '+0.8437499978*sin(2.*s)'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '-4.1054687503*sin(s)'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '+0.8437499978*sin(2.*s)'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '-4.1054687503*sin(s)'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '+0.8437499978*sin(2.*s)'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '-4.1054687503*sin(s)'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '+0.8437499978*sin(2.*s)'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '-4.1054687503*sin(s)'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '+0.8437499978*sin(2.*s)'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '-11.07064825*sin(2.*s)*bblb1rblb2rb*t**2'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '-16.60597234*sin(2.*s)*bblb1rblb2rb*cos(1.154700539*t)'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '+0.1994711401*sin(2.*s)*cclb2rblb2rb*t**2'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '+1.196826839*sin(2.*s)*t**4*bblb1rblb2rb'), ('+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3', '+8.571640841*sin(2.*s)*t**4*bblb2rblb2rb**3')]
<class 'list'>
Traceback (most recent call last):
  File "G:\докдисс\Программы Maple\Управление для Буссинеска\4degree\WithProduct.py", line 47, in <module>
    for i in product(anew, repeat=4):
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\products.py", line 605, in product
    prod = Product(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\products.py", line 199, in __new__
    obj = ExprWithIntLimits.__new__(cls, function, *symbols, **assumptions)
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\expr_with_limits.py", line 204, in __new__
    pre = _common_new(cls, function, *symbols,
  File "C:\ProgramData\Anaconda3\lib\site-packages\sympy\concrete\expr_with_limits.py", line 64, in _common_new
    free = function.free_symbols
AttributeError: 'list' object has no attribute 'free_symbols'

Блин, я немного другого хотел. Он формирует пары
  ('v', 'd' )
зато быстро , а хотелось бы
  (v*d )
py.user.next
Приведи свой код в исходное состояние
Здесь

Вместо этого участка кода
  
from itertools import product

Запиши этот код
  
import itertools

Вот этот участок кода
  
for i in product(anew, repeat=4):
    temp_1=eval('*'.join(i))
    XZ = XZ + integrate(temp_1, (t,0,1), (s, 0, pi))

Замени на этот код
  
for i in itertools.product(anew, repeat=4):
    temp_1=eval('*'.join(i))
    XZ = XZ + integrate(temp_1, (t,0,1), (s, 0, pi))
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB