简体   繁体   English

如何在wing-IDE中包含文件

[英]How to include file in wing-IDE

I have a file called tweet.py located on my desktop which contains numerous functions that I would like to use in the wing-IDE. 我的桌面上有一个名为tweet.py的文件,其中包含许多我想在wing-IDE中使用的功能。 How do I include the file so I can use the functions in the python shell? 如何包含文件,以便可以在python shell中使用函数? I looked online but did not find anything to help me. 我在网上看了一下,但没有任何帮助。 Thanks guys. 多谢你们。 I'm using ubuntu 14.04, if that helps. 我正在使用ubuntu 14.04,如果有帮助的话。

Open the file in Wing and then select Evaluate File in Python Shell from the Source menu. 在Wing中打开文件,然后从“源”菜单中选择“在Python Shell中评估文件”。 After that, functions/etc defined in the file can be accessed from the shell. 之后,可以从外壳访问文件中定义的功能/ etc。 You do need to redo that if you've edited the file. 如果您已编辑文件,则确实需要重做。

Or you may want to use the Active Range feature that's new in Wing 5.0.9: Select a range of code, and press the + icon in the Python Shell (top right) to make it the active range. 或者,您可能想使用Wing 5.0.9中的新“活动范围”功能:选择一个代码范围,然后按Python Shell(右上角)中的+图标使其成为活动范围。 Then you can easily reevaluate that range in the Python Shell by pressing the cog icon (or bind a key to the command python-shell-evaluate-active-range). 然后,您可以通过按下cog图标(或将键绑定到命令python-shell-evaluate-active-range)轻松地在Python Shell中重新评估该范围。

Another option is to set a breakpoint, debug to it, and then use the Debug Probe, which is a shell that lets you interact with the runtime state in the currently selected debug stack frame. 另一个选择是设置一个断点,对其进行调试,然后使用“调试探针”,它是一个外壳程序,可让您与当前选定的调试堆栈框架中的运行时状态进行交互。

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

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