python:我可以在不实际安装python的情况下运行python脚本吗? [英] python: Can I run a python script without actually installing python?

查看:342
本文介绍了python:我可以在不实际安装python的情况下运行python脚本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一些.py文件,希望在其他计算机上运行。目标机器未安装python,因此我无法按政策安装它。我所能做的就是复制文件,运行我的东西,然后将它们删除。

I have some .py files I wrote that I want to run on a different machine. The target machine does not have python installed, and I can't 'install' it by policy. What I can do is copy files over, run my stuff, and then remove them.

我试图做的就是将开发python文件夹移到目标计算机上, cd到python文件夹并运行 python.exe /path/to/.py/file 。它给我一个错误,指出未注册python.dll。如果我注册了DLL,这可能会使我跨过违反政策行。

What I tried was to just take my development python folder over to the target machine and cd to the python folder and run python.exe /path/to/.py/file. It gave me an error saying that python.dll was not registered. If I registered the DLL that is probably going to move me to far across the 'violating policy' line.

无论如何,我都可以在计算机上

Is there anyway I can accomplish running python files on a machine that does not have python actually installed (trying to get py2exe to work now, but it is painful)?

推荐答案

我决定走了,实际上还没有安装python(试图让py2exe现在工作,但是很痛苦)?与 cx_Freeze

I decided to go with cx_Freeze.

它创建了一个发行版,我可以简单地将其复制并移动到目标计算机。而且,它比py2exe 容易得多;此外,它似乎仍然正在维护(截至2011年3月10日),而py2exe开发似乎并不活跃。

It created a distro that I was able to simply copy and move to the target machine. Also, it was much easier to use than py2exe; further it seems that it is still being maintained (as of Mar 10, 2011), while py2exe development does not look as active.

这篇关于python:我可以在不实际安装python的情况下运行python脚本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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