[英]Converting a package from python2 to python3
I've downloaded the Trumbowyg WYSIWYG editor: http://alex-d.github.io/Trumbowyg/ as well as django-trumbowyg
for integrating it with django: https://github.com/sandino/django-trumbowyg 我已经下载了Trumbowyg WYSIWYG编辑器: http ://alex-d.github.io/Trumbowyg/以及django-trumbowyg
以便将其与django集成: https : //github.com/sandino/django-trumbowyg
However django-trumbowyg
is written for python2, whereas my app runs on python3. 但是django-trumbowyg
是为python2编写的,而我的应用程序是在python3上运行的。 Is it difficult to convert this package to python3? 将此包转换为python3很难吗? Or is it just a matter of making a few minor changes? 还是仅需进行一些小的更改即可? How would I go about it? 我将如何处理?
Read this https://docs.python.org/2/library/2to3.html and it will explain how to run your python program as a python 3 file. 阅读此https://docs.python.org/2/library/2to3.html ,它将说明如何将python程序作为python 3文件运行。 If you want to have the file written in python 3 you will need to read over how python 3 is different and change those difference. 如果要用python 3编写文件,则需要阅读python 3的不同之处并更改这些差异。
For your case you would be better off writing your app in python 2 if you aren't dependent on python 3 implementations. 对于您的情况,如果您不依赖python 3实现,那么最好使用python 2编写应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.