简体   繁体   English

如何在Google Cloud Shell上编辑python文件

[英]How to edit python file on Google Cloud Shell

I have created the basic "Hello World" web app and deployed it. 我已经创建了基本的“ Hello World” Web应用程序并进行了部署。 So I have the URL with my project name included in it. 因此,我有包含项目名称的URL。 I wanted to create a couple of changes to the source code, but when I try refreshing it shows no changes. 我想对源代码进行一些更改,但是当我尝试刷新时,它没有显示任何更改。 How do I make changes? 如何进行更改?

If you deployed the app 如果您部署了应用程序

gcloud app update

If it's testing in Cloud Shell 如果在Cloud Shell中进行测试

I missed where you stated the app was deployed and wrote the answer below. 我想念您说应用程序已部署的地方,并在下面写下了答案。 I'll leave it for future readers or in case it might help. 我会将其留给以后的读者使用,以防万一。

To stop the local server from the command line, you press the following: 要从命令行停止本地服务器,请按以下命令:

Mac OS X or Linux: Control-C Windows: Control-Break Mac OS X或Linux:Control-C Windows:Control-Break

Then restart again with 然后重新启动

dev_appserver.py app.yaml

This assumes you're completing the App Engine hello world tutorial. 假设您正在完成App Engine Hello World教程。

Still not working? 还是行不通? Maybe you have multiple processes running or something else is wrong. 可能您正在运行多个进程,或者其他错误。 Let's try killing all of the web server processes and restarting. 让我们尝试杀死所有Web服务器进程并重新启动。

ps aux | grep dev_appserver.py

Look at the process number. 查看进程号。

kill PROCESS_NUM_HERE

If you see multiple processes after running ps aux... then you should kill all of them. 如果在运行ps aux...后看到多个进程,则应将它们全部杀死。

Then restart 然后重启

dev_appserver.py app.yaml

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

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