简体   繁体   English

如何使用嵌入式 Python 在 cmd 中运行脚本?

[英]How can I run a script in cmd with an embedded Python?

An arbitrary application (say 'ArbApp') supports Python API and Python 3.8.3 is included together when it is installed (embedded Python).任意应用程序(例如“ArbApp”)支持 Python API,并且 Python 3.8.3 在安装时包含在一起(嵌入式 Python)。 But I don't have any method to execute that Python except for opening Python console from the menu of ArbApp as shown below.但我没有任何方法来执行该 Python,除了从 ArbApp 的菜单中打开 Python 控制台,如下所示。 在应用程序中打开 Python 控制台

Because that Python includes some sight-packages required for the app, I need to run some scripts with it especially in cmd .因为该 Python 包含应用程序所需的一些视觉包,所以我需要使用它运行一些脚本,尤其是在 cmd 中 How can I do that?我怎样才能做到这一点?

Note.笔记。

In ArbApp path, a zipped Python file exists.在 ArbApp 路径中,存在一个压缩的 Python 文件。 That's all.就这样。 Nor does the system environmental variables.系统环境变量也没有。 ——

Open up cmd and then type in "python3" if you have the latest version of Python downloaded.如果您下载了最新版本的 Python,请打开 cmd,然后输入"python3" This will open up Python in your command line.这将在您的命令行中打开 Python。 To run a specific script, you will have to navigate to the script's file location first, and once you're in it you can type "python3 [filename]" , replacing [filename] with your python script name, and that will run it for you.要运行特定的脚本,您必须先导航到脚本的文件位置,进入后您可以键入"python3 [filename]" ,将[filename]替换为您的 python 脚本名称,然后运行它为你。

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

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