简体   繁体   English

如何使用我的Java程序打包python脚本?

[英]How to package a python script with my java program?

So, I'm writing a program(mostly for practice, kind of for future convenience) that will show a java front-end when run, and depending on the input, will use a python script to crawl and interpret a webpage, then send the interpreted data back to java to format for the front end. 因此,我正在编写一个程序(主要是为了练习,为了将来的方便),它将在运行时显示一个Java前端,并且根据输入,将使用python脚本爬网和解释网页,然后发送解释后的数据返回java进行前端格式化。 I'm sure I can get this running on my own computer, but when I want to distribute my program for my friends to use, how can I ensure my java program, mainProgram.jar can find my python code, script_x.py. 我确定我可以在自己的计算机上运行它,但是当我想分发我的程序供朋友使用时,如何确保我的java程序mainProgram.jar可以找到我的python代码script_x.py。 Is there a way I can assure my python script will be supported. 有什么办法可以确保我的python脚本得到支持。 I've read that there are ways to include the necessary runtimes and such with your program when you build it, but would it still interact the same way with my java program if it was bundled with it's dependencies? 我已经读到有一些方法可以在构建程序时在程序中包含必要的运行时,例如,但是如果它与依赖项捆绑在一起的话,它仍会以相同的方式与我的Java程序交互吗? I can provide some sample code soon, but it's still a work in progress, as I don't have the python script finished yet. 我可以很快提供一些示例代码,但是由于我尚未完成python脚本,因此仍在开发中。

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

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