如何在未安装Python的计算机上运行使用Tkinter的Python 3.5程序? [英] How do I run a Python 3.5 program that uses Tkinter on a computer without Python installed?

查看:122
本文介绍了如何在未安装Python的计算机上运行使用Tkinter的Python 3.5程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Python 3.5中编写了一个使用Tkinter导入的程序。我正在尝试找出一种在没有Python的计算机上运行它的方法。首先,我尝试冻结它,但由于我发现冻结工具都不支持Python 3.5而无法进行冻结。然后,我尝试使用在线空闲服务器,但找不到支持Tkinter的服务器。我希望能够获取.exe文件或类似文件,但是如果我可以在线运行它,那么也有什么好主意吗?

I have coded a program in Python 3.5 that uses the Tkinter import. I'm trying to figure out a way to run it on computers that don't have Python. First I tried freezing it but I haven't been able to because none of the freezing tools I found support Python 3.5. Then I tried possibly using a online idle but I couldn't find any that support Tkinter. I would prefer to be able to get a .exe file or something similar but if I could run it online that would be good too any ideas?

EDIT

所以我现在已经使用pip成功下载了PyInstaller。我当前的问题是当我在控制台中键入此命令时:pyinstaller.exe --onefile --windowed Finder.py
我收到此错误:'pyinstaller.exe'无法识别为内部或外部命令,
可操作程序或批处理文件。

So I have now successfully downloaded PyInstaller using pip. My current problem is when I type this into the console: pyinstaller.exe --onefile --windowed Finder.py I get this error: 'pyinstaller.exe' is not recognized as an internal or external command, operable program or batch file.

编辑
我现在已经找到通往pyinstaller.exe的途径。现在,当我尝试使用它时,它说访问被拒绝。

EDIT I have now found the pathway to pyinstaller.exe. Now when I try to use it it says Access is denied.

推荐答案

经过大约三天的工作,我终于弄明白了。我首先以压缩形式下载了PyInstaleller并解压缩了它。然后,我将程序放在PyInstaller文件夹中。然后,我打开了一个常规命令提示符。然后,我键入cd,然后键入PyInstaller文件夹的位置。最后,我输入pyinstaller.py-一个文件--windowed program.py。然后,当我进入PyInstaller文件夹时,在dist文件夹中有一个名为program的文件夹,其中带有.exe文件。谢谢大家的所有帮助!

I finally figured it out after about three days of work. Fist I downloaded PyInstaleller in the zipped form and extracted it. Then I put my program in the PyInstaller folder. Then I opened a regular command prompt. I then typed cd then the location of the PyInstaller folder. Finally I typed pyinstaller.py --one file --windowed program.py. Then when I went into the PyInstaller folder there was a folder called program with the .exe file in the dist folder. Thanks everyone for all of your help!

这篇关于如何在未安装Python的计算机上运行使用Tkinter的Python 3.5程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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