在 Ubuntu 12.04 上使用终端打开带有 IDLE 的 Python 文件

Mic*_*ael 8 python command-line idle-python

如何在 Ubuntu 12.04 上使用终端打开带有 IDLE 的 python 文件(从桌面)?

我试图这样做:

$ idle open python_file.py
Run Code Online (Sandbox Code Playgroud)

它不是打开我的文件,而是创建另外两个文件:open python_file.py.

ste*_*ver 9

只是

idle python_file.py
Run Code Online (Sandbox Code Playgroud)

如果您希望它在后台运行(将控制权返回给终端,以便您可以键入其他命令),请添加“&”

idle python_file.py &
Run Code Online (Sandbox Code Playgroud)

如果您希望它在关闭终端后继续运行,您可以“拒绝”它

idle python_file.py & disown
Run Code Online (Sandbox Code Playgroud)


NKN*_*NKN 5

您不需要使用“开放”一词。 帮助说:

idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...

-c command  run this command
-d          enable debugger
-e          edit mode; arguments are files to be edited
-s          run $IDLESTARTUP or $PYTHONSTARTUP first
-t title    set title of shell window
Run Code Online (Sandbox Code Playgroud)

你可以这样做:

idle file_you_want_to_open.py 
or 
idle.py file_you_want_to_open.py
Run Code Online (Sandbox Code Playgroud)

如果该文件不存在,则会创建它。