我如何编译多个py文件作为一个? [英] How do I compile multiple py files as one?

查看:348
本文介绍了我如何编译多个py文件作为一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经写了许多小模块(maya的工具集)需要编译到单个.pyc文件中。有没有一个模块,只是这样做?或者你能告诉我从哪里开始?教程?我甚至不知道要查找什么条件。

解决方案

你甚至不需要做蛋,只需拉起你的文件,把zip文件放到你的python路径。 Maya的python版本默认包括 zipimport 模块,所以只要maya可以找到你的zip文件,它就工作。



以下是您可能会发现有用的工具分发整个主题的一些讨论:



http://tech-artists.org/forum/showthread.php?3271-Distribution- techniques-for-external-Python-tools& highlight = distribute



http:// tech-artists .org / forum / showthread.php?3987-Maya-GitHub-and-Script-Paths-for-Mel-and-Python-How-Does-Do-Do& highlight = distribute



http://tech-artists.org/forum/showthread.php?3752-Best-Way-to-Share-Your-Scripts&highlight=distribution


I am new to Python and am totally lost as to where to even start to get this done.

I have written many small modules (a toolset for maya) that need to be compiled into on single .pyc file. Is there a module that just does this? Or can you tell me where to go to start? A tutorial? I don't even know what terms to look for.

解决方案

You don't even need to make an egg, you can just zip up your files and put the zip file onto your python path. Maya's version of python includes the zipimport module by default so it 'just works' as long as maya can find your zip file.

Here are some discussions of the whole topic of tools distribution you might find useful:

http://tech-artists.org/forum/showthread.php?3271-Distribution-techniques-for-external-Python-tools&highlight=distribute

http://tech-artists.org/forum/showthread.php?3987-Maya-GitHub-and-Script-Paths-for-Mel-and-Python-How-Would-You-Do-It&highlight=distribute

http://tech-artists.org/forum/showthread.php?3752-Best-Way-to-Share-Your-Scripts&highlight=distribution

这篇关于我如何编译多个py文件作为一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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