Krion 3 Posted March 10 Hi, I have just installed the Python 3 version of Houdini to test out if I can use old code with it. I had read something about an included convert-script. My own shelf tool which references an old python script in an own PYTHONPATH of mine produces this error: Do I need to rewrite all my old code? Thanks, Share this post Link to post Share on other sites
kiryha 67 Posted March 10 There is no such a big difference between Python2 and 3, so re-writing should not be hard. In Python 3 "print" is not a statement anymore, it is a function, which means you have to place everything in parentheses: print ('Hello, World!') Share this post Link to post Share on other sites
Stalkerx777 160 Posted March 16 (edited) On 3/10/2021 at 7:41 AM, kiryha said: There is no such a big difference between Python2 and 3, so re-writing should not be hard. In Python 3 "print" is not a statement anymore, it is a function, which means you have to place everything in parentheses: print ('Hello, World!') This is simply not true. There's a huge difference between python 2 and 3. There's a reason why there's still massive amounts of Python 2 code around even after 12 years since Python 3 came out. Changes to import mechanics, strings and unicode, iterators, metaclasses just to name a few. Switching to Python 3 is not trivial. For simple scripts, converting manually is a reasonable option, for bigger projects I use this tool: futurize Quote Do I need to rewrite all my old code? Check out this guide: https://docs.python.org/3/howto/pyporting.html Edited March 16 by Stalkerx777 typo 1 Share this post Link to post Share on other sites
kiryha 67 Posted March 17 18 hours ago, Stalkerx777 said: There's a huge difference between python 2 and 3. My bad, you are right. But I was assuming the script is quite simple, and in that case, I guess it can be easy to update. Share this post Link to post Share on other sites