简体   繁体   English

通过移动设备上的网络套接字将Livecode本机应用程序与Python应用程序集成

[英]Integrating Livecode native apps with Python apps via network sockets on mobile

As an alternative to having to create an “external” in c/c++/objc to a new Livecode application, I have developed instead a Python network socket app that communicates with it via sockets. 作为不必在c / c ++ / objc中为新Livecode应用程序创建“外部”的替代方法,我开发了一个Python网络套接字应用程序,该应用程序通过套接字与之通信。 The reason for this is that I needed to use some functions provided by some of my “custom” Python libraries. 原因是我需要使用某些“自定义” Python库提供的功能。 These functions are not doable in Livecode natively at this time. 目前,这些功能无法在Livecode中本地执行。 The communication between the Livecode and the Python apps works just as I desire. Livecode和Python应用程序之间的通信按照我的期望进行。

I have only tested this technique in a desktop app on OSX for now. 我目前仅在OSX的桌面应用程序中测试了此技术。 When saving the standalone, I've bundled my compiled Python app in the “Standalone LC Application Settings” and the whole thing installs and works without problems. 保存独立版本时,我将编译后的Python应用程序捆绑在“独立LC应用程序设置”中,整个程序可以安装并正常运行。

Now, can the same task possibly be accomplished for IOS and/or Android apps? 现在,可以为IOS和/或Android应用程序完成相同的任务吗? Can I bundle a compiled Python script with a Livecode IOS/Android mobile app in order to run in these devices? 是否可以将已编译的Python脚本与Livecode IOS / Android移动应用程序捆绑在一起,以便在这些设备上运行? I'm aware of course, that Python is not installed by default in either IOS or Android. 我当然知道,IOS或Android默认未安装Python。 What is the best way to accomplish this then? 那么,实现此目标的最佳方法是什么? I'm pretty new to Livecode. 我是Livecode的新手。 I've tested my Python script on Pythonista on both an iPhone and an iPad just to make sure it will run and it works flawlessly there. 我已经在iPhone和iPad上的Pythonista上测试了我的Python脚本,只是为了确保它可以运行并且可以在其中完美运行。 So, how do I package my Livecode app with my python script so they could be both installed and ran in the mobile devices? 那么,如何将我的Livecode应用程序与python脚本打包在一起,以便它们既可以安装又可以在移动设备中运行?

How do you call your Python scripts? 您如何称呼您的Python脚本? The Shell command is not available on mobile so I guess you would need to create an external that would call your compiled script. Shell命令在移动设备上不可用,因此我想您需要创建一个外部来调用已编译的脚本。 But then sockets isn't available either on mobile yet (will soon be afaik). 但是随后套接字在移动设备上也不可用(很快将成为afaik)。 But out of curiosity what is your python script doing that can't be done in LiveCode? 但是出于好奇,您的python脚本在LiveCode中无法完成什么工作?

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

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