可以在没有Python的计算机上运行python程序吗?C/C ++呢? [英] Can a python program be run on a computer without Python? What about C/C++?

查看:41
本文介绍了可以在没有Python的计算机上运行python程序吗?C/C ++呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以创建Python程序,将其发送到远程计算机,然后在没有安装Python的计算机上运行该程序吗?我听说您做不到,因为Python需要解释.如果这是真的,那么这似乎很奇怪,因为除非每个人都决定安装Python,否则很难分发您的程序.

Can I create a Python program, send it to a remote computer, and run it there without that computer having Python installed? I've heard that you cannot, as Python needs to be interpreted. If this is true, then it seems very odd as it would be hard to distribute your program unless everyone decides to install Python.

另外,关于C和C ++呢?它们可以在没有安装语言的情况下在远程计算机上运行吗?(我认为您可以,因为它是一种编译语言).

Also, what about C and C++? Can they be run on a remote computer without having the language installed? (I think you can, as it is a compiled language).

我不确定,想澄清一下.

I'm not exactly sure and would like clarification.

我对此有一些困惑的答案,而且不确定去哪里.我看到我可以在程序中包含Python库,并且可以使用py2exe.

I'm getting some mixed answers on this and am not sure where to go. I see that I can include the Python library in the program and I can use py2exe.

但是,我对C和C ++感到困惑.我是否必须在程序中包括它们的库?它们只能在某些计算机上运行吗?编译器是否允许它在所有计算机上运行?

However, I'm confused on C and C++. Do I have to include their libraries in the program? Can they only be run on certain machines? Does the compiler allow it to run on all machines?

推荐答案

查看适用于Windows和Mac的py2exe和py2app.但是,运行OSX和大多数现代Linuces的Mac已安装Python.

Look at py2exe and py2app for Windows and Mac. Macs running OSX and most modern Linuces have Python installed, however.

C/C ++应用程序通常被编译为可在一种机器/OS体系结构(例如32位Windows或64位OSX)上运行的可执行文件;这样的可执行文件可以在部分而非全部机器上运行.例如,64位Windows或OSX可以运行针对其各自OS的32位或64位版本构建的程序.

C/C++ apps are normally compiled to executables which work on one machine/OS architecture (e.g. 32-bit Windows, or 64-bit OSX); such an executable can run on some but not all machines. For example, 64-bit Windows or OSX can run programs built either for the 32-bit or 64-bit flavor of their respective OSes.

这篇关于可以在没有Python的计算机上运行python程序吗?C/C ++呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆