使用 IDLE 使用完整文件路径启动脚本 [英] Use IDLE to launch script using the full file path

查看:46
本文介绍了使用 IDLE 使用完整文件路径启动脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Notepad++ 来编辑我的 Python 脚本,我希望能够使用快捷方式让我的脚本在 IDLE 中运行.目前,我有:

I'm currently using Notepad++ to edit my python script, and I would like to be able to use a shortcut to make my script run in IDLE. Currently, I have:

cd C:\Python32
pythonw.exe Lib\idlelib\idle.pyw -c "$(FULL_CURRENT_PATH)"

当我尝试运行它时,在 C:\Users\...

When I try to run it, I get a Syntax error on the : in C:\Users\...

但是,如果我省略 -c,IDLE 会在它的编辑器中正确打开文件,然后我就可以运行它了.

However, if I omit -c, IDLE properly opens up the file in it's editor and then I am able to run it.

我觉得我错过了一些简单的东西,有人能帮我吗?

I feel like I'm missing something simple, can anyone help me out?

推荐答案

Argument -c 用于启动命令,如果需要运行文件,则使用argument -r

Argument -c used to start the command, if you need to run a file, then use argument -r

我使用这个命令:C:\Python27\Lib\idlelib\idle.bat -r "$(FULL_CURRENT_PATH)"

这篇关于使用 IDLE 使用完整文件路径启动脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆