英文:
Is it possible to use Python with Go
问题
> 可能重复:
> 在GAE中将Python与更快的语言混合以进行优化
<!-- 自动插入文本结束 -->
我想知道是否可以在Go中使用Python,我刚刚开始接触Go(无意中哈哈,尽管它存在很长时间),感觉像Python,我喜欢它,但我不打算学习它,因为Python已经满足了我的需求,我只是想知道,是否可以使用Python SDK和Go在Google App Engine上创建一个应用来完成一些任务?
我已经知道它们对于Go有完全不同的方式
编辑
我觉得我刚刚问了一个愚蠢的问题,因为我刚刚发现你必须编译Go!
无论如何,我会保留这个问题,也许今天我会得到一个出乎意料的好答案。
英文:
> Possible Duplicate:
> Mixing python with a faster language for optimization in GAE
<!-- End of automatically inserted text -->
I wounder if you can use python with Go, I have just introduced myself to Go (by mistake lol, although that it exists long time ago) to Go, it feels like python, I like it, but I'm not planning to learn it because python satisfies me, I'm just wondering, is it possible to create an app on google app engine using python sdk and Go for some tasks?
I already know that they have a totally different for go
EDIT
I think i have just asked a stupid question because I have just found out that you have to compile Go!
anyway I'll keep the question for today maybe I'll have a good answer that I'm not expecting.
答案1
得分: 5
你可以在同一个应用程序中使用不同的语言,但是每个语言都是在不同的版本中。它们将可以访问相同的数据存储和内存缓存,但是CRON和(我认为)任务只能在活动版本中工作(因为它们使用相对路径针对主版本URL)。你需要使用HTTP在不同版本之间进行“通信”。你还可以将主应用程序设置为Python,而后端可以是Go或Java等其他语言。
Go是编译语言,但是Go SDK会为你完成所有工作,每次更改代码时重新编译应用程序。这种方式非常方便和有趣,可以尝试一下Go。
英文:
You can use different languages in the same app -- however, each one in a different version. They will have access to the same datastore and memcache, however CRON and (I think) tasks will only work for the active version (because they target the main version url using a relative path). You would have to "talk" between versions using HTTP. You can also have the main app in Python and a Go or Java backend, etc.
Go is compiled, but the Go SDK do all the work for you, re-compiling the app each time you change your code. It is pretty neat and fun to try Go this way.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论