简体   繁体   English

在shell中运行python的脚本

[英]The script which runs python in shell

I am running python on Linux. 我在Linux上运行python。 I want to know the script which runs the python interpreter. 我想知道运行python解释器的脚本。

Meaning, Whenever i run the command python on a linux shell, a Python prompts opens and get input from keyboard and take those inputs to the underlying python interpreter.I want to know which shellscript (or python script) does this?. 意思是,每当我在linux shell上运行python命令时,Python提示都会打开并从键盘获取输入,并将这些输入带到底层python解释器中。我想知道是哪个shellscript(或python脚本)执行的? I want to know the location of it. 我想知道它的位置。

It's not a python script you can simply get and modify as any .py file. 这不是一个Python脚本,您可以简单地将其获取并修改为任何.py文件。 In order to play around with interactive interpretter you will have to download the python sources and go through them, as it's a build-in part of it (for performance sake). 为了使用交互式解释器,您将必须下载python源并仔细检查它们,因为它是其中的内置部分(出于性能考虑)。

You can read up the details on http://docs.python.org/devguide/ 您可以在http://docs.python.org/devguide/上阅读详细信息

The answer to your question as asked is None ! 您所提出的问题的答案是“ 无”

The Linux default python prompt is part of the python interpreter and is a binary file not a python script or shell script. Linux默认的python提示符是python解释器的一部分,并且是二进制文件, 而不是 python脚本或shell脚本。 The path to the binary can be found by the Linux command: 二进制文件的路径可以通过Linux命令找到:

which python

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

相关问题 如何在运行Python脚本的Shell脚本中捕获Cntrl + C - How to catch Cntrl + C in a shell script which runs a Python script 运行多个Shell命令并等待结果的Python脚本 - Python script which runs multiple shell commands and waits for the result 脚本在Python中运行,但不在Python Shell中运行 - Script runs in Python but not in Python shell Python 运行简单 shell 脚本的文本菜单 - Python text menu that runs simple shell script Python脚本使用双击和IDLE运行,但不运行Windows CMD Shell - Python script runs with double-click and IDLE but not windows CMD shell Python脚本在IDLE Shell和Bash中以.py而不是.exe的形式运行 - Python Script runs in IDLE Shell and Bash as .py not as .exe Python 在执行将进程作为守护程序运行的 shell 脚本时挂起 - Python hangs when executing a shell script that runs a process as a daemon 运行一个运行 python 程序的 shell 脚本,然后运行一个 R 程序 - Running a shell script that runs a python program, then an R program shell 运行 python 脚本后终端不关闭 - Terminal doesn't close after shell runs the python script 使用Pyinstaller将运行bash脚本的python脚本转换为可执行文件 - Convert python script which runs a bash script to executable file with Pyinstaller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM