1
$\begingroup$

I am working with Blender 2.78 where plugins are apparently programmed in python 3. However I will need a custom library programmed in python 2 to be accessed from my plugin. As there seem to be python 2 and python 3 in /blender/2.78/python/lib, is there now a way of using python 2 libraries in my plugin?

$\endgroup$
-2
$\begingroup$

"script.py" is the name of your script:

2to3 -w script.py

https://docs.python.org/2/library/2to3.html

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ I think it would help to expand your answer to explain what that command is and how to use it, even if it means quoting some of what is said at that link. At the minute, if that link goes down at some point, this answer will not be very clear. $\endgroup$ – Ray Mairlot Mar 13 '17 at 17:06
  • $\begingroup$ I think it's pretty self explanatory. He's got Python 2 code he wants to use in Python 3. That's how you do it. $\endgroup$ – Doyousketch2 Mar 13 '17 at 19:45
  • $\begingroup$ ...and if the site goes down, just like any other tool on the commandline, you use "man 2to3" or "2to3 --help" $\endgroup$ – Doyousketch2 Mar 13 '17 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.