简体   繁体   English

有想法的机盖代码编辑器名称空间警告

[英]Enthought canopy code editor namespace warnings

Canopy code editor underlines the variables that are undefined. 机盖代码编辑器强调未定义的变量。 However, once variables are loaded to the namespace by running another python script from the current script, it still does the error highlighting even though such variable exists and can be used. 但是,一旦通过从当前脚本运行另一个python脚本将变量加载到命名空间中,即使存在并且可以使用该变量,它仍然会突出显示错误。

Is there any way to make it see the loaded variables too? 有什么办法可以让它看到加载的变量吗?

Thanks. 谢谢。

No there is not, and should not be, because as the script runs, it won't have access to those variables. 不存在,也不应该存在,因为在脚本运行时,它将无法访问这些变量。

For more information, please see https://stackoverflow.com/a/26413862/1988991 有关更多信息,请参阅https://stackoverflow.com/a/26413862/1988991

You can run a script in the ipython shell namespace by using the Run magic's -i option, but this is not the normal usage, nor is it useful for testing a script which will be run independently. 可以使用Run magic的-i选项在ipython shell命名空间中运行脚本,但这不是正常用法,对于测试将独立运行的脚本也没有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM