简体   繁体   English

如何在Azure应用服务中运行Python shell

[英]How to run a Python shell in azure app service

In Azure App Service , I knew there is a Kudu debug console like the following: Azure App Service中 ,我知道有一个Kudu调试控制台 ,如下所示:

在此输入图像描述

Can be used to trigger commands in that console. 可用于在该控制台中触发命令。

but I found this console will be gotten stuck if I trigger a python shell like this: 但是如果我触发这样的python shell,我发现这个控制台会被卡住:

D:\\home\\site\\wwwroot\\env\\Scripts>python.exe d:\\家\\网站\\ wwwroot的\\ ENV \\脚本> python.exe

在此输入图像描述

Is it possible having an interactive python shell under azure app service like Heroku ? 是否可以在像Heroku这样的天蓝应用服务下使用交互式python shell? Thank you. 谢谢。

Unfortunately, this is not something that will work in Kudu Console today. 不幸的是,这不是今天在Kudu Console中可行的。 The problem is that Kudu Console is not a true shell, and does have some limitations when it comes to running interactive commands. 问题是Kudu Console不是一个真正的shell,并且在运行交互式命令时确实有一些限制。

As a workaround you can run python with the command flag like so 作为一种解决方法,您可以使用命令标志运行python,就像这样

d:\home>python -c "import os;print(os.environ)"

although unless there is a way or trick to create multline on Kudu Console you would be limited to python without indentation 虽然除非有一种方法或技巧可以在Kudu控制台上创建多线,但你可以限制为没有缩进的python

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

相关问题 如何在Azure App Service上运行django manage.py命令 - How to run django manage.py command on Azure App Service 如何在运行 Z2B9AFB89A6ACC1575B159BFCAZ3 应用程序时在 azure web 应用程序上运行 shell 脚本? - How to run shell script on azure web app while running django app? 如何从 Python 重新启动 Azure 应用服务槽? - How can I restart an Azure App Service slot from Python? 如何将多个 python flask 应用程序部署到单个 azure 应用程序服务? - How to Deploy multiple python flask apps to a single azure app service? 如何使用 Python 在 Azure 应用服务中获取 AAD 客户端配置文件信息 - How to get AAD client profile information in Azure app service with Python 如何在 azure python 应用服务中将目录添加到 PATH - How to add directory to PATH in azure python app service 如何将Azure App Service Python版本从3.9.7更改为3.9.12? - How to change Azure App Service Python version from 3.9.7 to 3.9.12? Azure 应用服务上 Python 的本地日志在哪里? - Where is local logs for Python on Azure App Service? azure 应用服务中的 Python ModuleNotFoundError 包 - Python ModuleNotFoundError package in azure app service 带有python脚本的Azure Web应用程序服务 - Azure web app service with python script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM