简体   繁体   English

如何使用selenium打包/分发Python 2.7应用程序?

[英]How do I package/distribute a Python 2.7 application with selenium?

I am fairly new to Python and I have developed a program that has a Tkinter GUI and uses selenium WebDriver to scrape information. 我是Python的新手,我开发了一个程序,它有一个Tkinter GUI并使用selenium WebDriver来抓取信息。 I need to find a way to package all of this so that it can be used on other computers. 我需要找到一种方法来打包所有这些,以便它可以在其他计算机上使用。 I call three extra modules (selenium, openpyxl, BeautifulSoup) in my script. 我在脚本中调用了三个额外的模块(selenium,openpyxl,BeautifulSoup)。 Is there a way to make this an executable file? 有没有办法使这个可执行文件? Or will they have to call it through their command window? 或者他们是否必须通过命令窗口调用它? I have heard of a program called Advanced Installer, would this do what i want? 我听说过一个名为Advanced Installer的程序,这会做我想要的吗?

Thank you 谢谢

I realize that my question is very broad, i just don't know where to begin. 我意识到我的问题非常广泛,我只是不知道从哪里开始。 This application is only applicable to people within my company, so i don't want it to be available to others. 此应用程序仅适用于我公司内部的人员,因此我不希望其他人可以使用它。 I just want to be able to move all the necessary files to another computer and they can just click one button and go. 我只是希望能够将所有必要的文件移动到另一台计算机,他们只需单击一个按钮即可。

I encourage you to read how to package a python application. 我鼓励您阅读如何打包python应用程序。 Typically what you want to do is release your application on the Python Packaging Index , so that your app is available as a Python module for other developers and users. 通常,您要做的是在Python Packaging Index上发布您的应用程序,以便您的应用程序可用作其他开发人员和用户的Python模块。 Once you release your app on PyPI, you can go ahead and provide users with further options like easy install. 在PyPI上发布应用程序后,您可以继续为用户提供更多选项,例如轻松安装。

Note that releasing your app and making it available to the world is something that you'd certainly want to do. 请注意,释放您的应用并将其提供给全世界是您当然想要做的事情。

The best way to package your application is by using distutils . 打包应用程序的最佳方法是使用distutils

Since packaging a python app is a considerably broad topic, I won't be able to cover it in entirety here. 由于打包python应用程序是一个相当广泛的主题,我将无法在此完整地介绍它。 However, here are a few guides to get you started: 但是,这里有一些指南可以帮助您入门:

Finally, a good practice is to look at existing open-source Python projects and look at the way their setup script and the MANIFEST.in file is written. 最后,一个好的做法是看现有的开放源代码Python项目,并期待在他们的方式setup脚本和MANIFEST.in文件的写入。 For doing that, you would need to understand the way the project is structured, which is important in realizing the correct way to package an application. 为此,您需要了解项目的结构方式,这对于实现打包应用程序的正确方法非常重要。

Hope this helps. 希望这可以帮助。 All the best! 祝一切顺利!

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

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