如何连接IDL和python,以便python代码/输出可以被调用到IDL代码中用作输入?

2024-10-02 12:33:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在IDL代码中使用python输出作为输入。我在IDL中完成了以下操作:

np = Python.Import('numpy') 
Python.Run(test_TN_msis.py) 
print, This is a test to pull the temperature data list:  
temp  
end

我在IDL命令行中收到的错误是:

IDL> .run test_IDLPython_bridge

Python.Run(test_TN_msis.py)
                           ^
% Syntax error.
  At: /home/charlotte/Desktop/raids/pyglow/examples/test_IDLPython_bridge.pro, Line 2
% 1 Compilation error(s) in module $MAIN$.

我曾尝试在哈里森地理空间网站上使用“IDL到Python”和“Python到IDL”桥接信息,但我不熟悉IDL,因此迷路了。非常感谢您的帮助


Tags: run代码pytestimportnumpynperror

热门问题