필터 지우기
필터 지우기

Error:Output argument "pythonAstResult" (and possibly others) not assigned a value in the execution with "internal.​PythonImpo​rter.analy​zePythonAs​t" function.

조회 수: 7 (최근 30일)
Hello,
I am getting the following error while trying to run the simple python code in "Python Importer".
Error:Output argument "pythonAstResult" (and possibly others) not assigned a value in the execution with "internal.PythonImporter.analyzePythonAst" function.
Code cannot be more simplified than this :-
var1 = 5
var2 = 2
sum_int = var1 + var2
print(sum_int)
I can't find what is the mistake. Can anyone please help.
  댓글 수: 3
Rajat Kumar Raghav
Rajat Kumar Raghav 2023년 10월 17일
Actually Python Importer only works if codes are written in defined method, as shown below -
def sum2ints(var1, var2):
sum_int = var1 + var2
print(sum_int)
return sum_int
if __name__ == '__main__':
num1 = int(input('Enter the number1: '))
num2 = int(input('Enter the number 2: '))
output = sum2ints(num1, num2)
print('Final output is : ', output)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by